These are chat archives for kbknapp/clap-rs

Nov 2018
Nov 26 2018 15:48

Hi all
could you help me please?
I want to get path as arg.
So, input line maybe:

./myprogram "."
./myprogram ".*"
./myprogram file1.txt
./myprogram file1.txt file2.txt file3.txt ...

how can I get variable number of parameters?
I wrote:

 let args = App::new("Checker")
                    index( 1)
                    .help("help page")

So, that covers first three cases. But in case ./myprogram file1.txt file2.txt file3.txt ..., I dont know what to do

Matthew Klein
Nov 26 2018 21:08
Arg::possible_values() takes a &'a [&'b str]. I have a Vec<String>. How would I go about converting that? The arg_enum! macro doesn't quite do what I want, since it doesn't convert the casing as I would like.