You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
It would be great to have a function in the Arg struct that facilitates the addition of command-line examples when the help is printed. This is very often cited as a best practice in designing command-line tools.
Describe the solution you'd like
I believe that something like this will be really great
let m = App::new("prog")
.author("Me, [email protected]")
.version("1.0.2")
.about("Explains in brief what the program does")
.examples("prog -i myfile -o myout")
.get_matches();
Alternatives, if applicable
Actually, as an alternative, I add examples into the about() function:
let m = App::new("prog")
.author("Me, [email protected]")
.version("1.0.2")
.about(
"Explains in brief what the program does\n\
EXAMPLES:\n\
\tprog -i myfile -o myout"
)
.get_matches();
But this does not come with the default clap color pattern for help.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
In the help text printed by clap, heading like USAGE, ARGS, FLAGS are colored in magenta/yellow, but not for the workaround I currently use. This can be added using color crates but I think directly implementing it in clap would be a really nice feature.
Please complete the following tasks
Clap Version
2.33
Describe your use case
Hi,
It would be great to have a function in the Arg struct that facilitates the addition of command-line examples when the help is printed. This is very often cited as a best practice in designing command-line tools.
Describe the solution you'd like
I believe that something like this will be really great
Alternatives, if applicable
Actually, as an alternative, I add examples into the
about()
function:But this does not come with the default clap color pattern for help.
Additional Context
No response
The text was updated successfully, but these errors were encountered: