These are chat archives for kbknapp/clap-rs

28th
Nov 2016
Jamie Mason
@JamieMason
Nov 28 2016 22:37
hello, is it possible to capture trailing args without using a sub command? eg. imageoptim --no-colors ./images ./photos. I've seen mention of TrailingVarArg but it looks like that is only be usable with sub commands? Thanks.
Kevin K.
@kbknapp
Nov 28 2016 22:39
Yes it's possible, you can set the final positional args to multiple(true) provided none of the values start with a hyphen
TrailingVarArg works without subcommands too
TrailingVarArg is the same as passing myapp -- val1 val2 only without having to use the -- to separate the list of trailing values...and should allow values that start with a hyphen
Jamie Mason
@JamieMason
Nov 28 2016 22:45
thanks a lot @kbknapp
Kevin K.
@kbknapp
Nov 28 2016 22:46
No prob! :+1: