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)
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 animpl HelpBuilder
which we can tell pass it parts of the help output and theimpl
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