clap icon indicating copy to clipboard operation
clap copied to clipboard

Help heading descriptions

Open IgnisDa opened this issue 3 years ago • 2 comments

Discussed in https://github.com/clap-rs/clap/discussions/4588

Originally posted by IgnisDa December 30, 2022 Hello. Awesome project!

I want to display a help string after the help heading.

image

For reference, this is what it should end up looking like:

image

Is this possible?

This is the code: https://github.com/IgnisDa/rust-libs/blob/53fcfb13510e69297ff98173239f962b3f4e97d5/crates/reflector/src/cli.rs#L83

IgnisDa avatar Dec 30 '22 17:12 IgnisDa

At the moment, help headings are defined in an ad hoc fashion unlike in Python. So the first question is whether we just add Command::help_heading_description or make it like ArgGroup and allow mixing ad-hoc with structured definitions.

Second, is what to call this (description, help, etc).

We also need to decide whether we support this only for long help of if we provide both types.

Lastly, we'd need to decide what the whitespace situation should be, both newlines and indentation.,

Ideally, we would compare the user-visible aspects of this with other CLI parsers to see what lessons we can learn from them

epage avatar Dec 30 '22 17:12 epage

just throwing in that Deno is extremely interested in having this feature, mainly for linking to pages of our documentation related to the heading section

crowlKats avatar Aug 07 '24 09:08 crowlKats