These are chat archives for kbknapp/clap-rs

26th
Jun 2018
Vitaly Shukela
@vi
Jun 26 2018 12:42
(Already implemented scraping help output and filtering strings)
Will such pull request have a good chance being accepted?
Kevin K.
@kbknapp
Jun 26 2018 14:40
You can add a notice in something like App::after_help
If you're using something like your own --help you can re-create the App struct with all the applicable args set to hidden(true) as creating the App struct only takes a few ns
Especially if you have a function like fn create_app(should_hide: bool) -> App<'static, 'static>
Vitaly Shukela
@vi
Jun 26 2018 14:45
How does this interact with structopt?
Kevin K.
@kbknapp
Jun 26 2018 14:47
You'd have to use structopts YourStruct::clap method to create the App struct...although it would probably take a fair amount of macros to get it to work the same
Vitaly Shukela
@vi
Jun 26 2018 14:47

fair amount of macros

It would turn into a macro implementation of structopt.

Kevin K.
@kbknapp
Jun 26 2018 14:48
In the 3.x branch there is a App::mut_arg method which does what you'd want. However, that's not released yet