These are chat archives for kbknapp/clap-rs

17th
Jan 2017
Vinícius dos Santos Oliveira
@vinipsmaker
Jan 17 2017 08:32
hey, how do I create a command such as ls (i.e. multiple "positional"/index/non-specified arguments)
I don't see which method from ArgMatches will get me these values
I have two index parameters, so I don't mind if the last one "swallow" all the remaining arguments as a solution
Kevin K.
@kbknapp
Jan 17 2017 13:13
You use multiple(true) on the last one. You can also specify the index manually with index(num) (which starts at 1 not 0) but it's not 100% necessary because if you don't specify it, they'll be assigned indexes in the order you define them.
Then use ArgMatches::values_of(arg) to get the values from the final one.