epage / clapng

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
0 stars 0 forks source link

[modular] Decouple help format from help generation #227

Open epage opened 2 years ago

epage commented 2 years ago

Issue by epage Tuesday Oct 19, 2021 at 15:40 GMT Originally opened as https://github.com/clap-rs/clap/issues/2914


Please complete the following tasks

Clap Version

master

Describe your use case

Building on #2913, we can decouple help generation from help formatting, which would allow us to reuse it for manpage generation or for code-gen of help output to avoid doing help generation at runtime, allowing users to reduce bloat.

Describe the solution you'd like

Refactor clap_help to accept an impl HelpBuilder which we can tell pass it parts of the help output and the impl is responsible for formatting for the target (terminal, man page, pre-proc for code-gen, etc)

Alternatives, if applicable

No response

Additional Context

No response