These are chat archives for kbknapp/clap-rs

10th
Jun 2016
Brian Pearce
@brianp
Jun 10 2016 20:35
Is there any kind of passthrough string of all options? I wrote my subcommand as a separate bin, so the subcommand really just shells out to that executable. Which means right now I’ve setup the MainApp with the subcommand and all it’s params, which gets repeated in the SubCommand App.
I’d rather not duplicate them, or have to parse for each option to passthrough. Is it possible I can designate the SubCommand in the MainApp, then simply pass all given options through to my shell out?
So the MainApp doesn’t have to hold any information about what the SubCommandApp accepts.
Kevin K.
@kbknapp
Jun 10 2016 21:14
Yes, see the AllowExternalSubcommand setting
In the v3 branch which is a WIP right now, should make this more pleasant
Brian Pearce
@brianp
Jun 10 2016 21:16
omgerd your’ve thought of everything :)
Kevin K.
@kbknapp
Jun 10 2016 21:16
But it's not bad now, just less intuitive since it's somewhat of an edge case
Hahhahaha we try ;)
If the AllowExternalSubcommand isn't what you want, look at the TrailingVarArg
One of the two should do what you're looking for