These are chat archives for kbknapp/clap-rs

Jun 2016
Brian Pearce
Jun 12 2016 05:28
I ended up using AppSettings::TrailingVarArg. It’s not perfect because stuff like —help doesn’t make it to the subcommand, the MainApp will intercept that and show it’s usage etc. I found trying to use ExternalSubCommand was still picking up the first arg as MainApps first named arg, than skipping the second arg as the “unknown subcmd” then listing the available args after that.
ie. mainapp subcmd arg1 arg2
would get parsed as subcmd is the first arg to mainApp. arg1 is parsed as the unknown subcmd, and arg2 is the only arg picked up for the external subcommand
Kevin K.
Jun 12 2016 14:51
Did you try TrailingVarArg on the subcmd instead of the MainApp?
@brianp that's what I meant when I said try that out. Sorry I didn't specify!