These are chat archives for kbknapp/clap-rs

23rd
Jun 2018
Vitaly Shukela
@vi
Jun 23 2018 14:35

How do I do --help=<topic> with clap (or actually with structopt)?

Obviously, without turning off the usual generated --help message.

Kevin K.
@kbknapp
Jun 23 2018 15:45
You have to add an option with a long of --help. Then you have to handle the display of the message manually, however you can still have the help message generated for you by using App::print_help
Vitaly Shukela
@vi
Jun 23 2018 15:47
Thanks for the info.
Vitaly Shukela
@vi
Jun 23 2018 22:35

How do I do two levels of --help - simple and advanced? Simple mode should show subset of flags and options, advanced mode should show everything.

I see clap::Arg::hidden, but I'm not sure if I can unhide it (structopt is in use).

Vitaly Shukela
@vi
Jun 23 2018 22:40
Also how do I add a notice in OPTIONS and FLAGS that some items are hidden?
Vitaly Shukela
@vi
Jun 23 2018 23:06
Can I iterate and unhide args in structopt-generated clap::App?
Vitaly Shukela
@vi
Jun 23 2018 23:52
Is the best option to just obtain the help message as string, then post-process it, removing some lines?