I'm using the clap crate to take commandline arguments. I have defined input:
.arg(Arg::with_name("input") .short("i") .long("input") .value_name("INFILE") .default_value( <INPUT> ) .help("Sets the input file name") .takes_value(true))
But I would like the default if you don't give any swtiches that it uses the argument as the input file. So I'd like the user to be able to do something like:
myapp -i inputfile.txt -o output.txt or just
myapp inputfile.txt to do the same thing.
the default output file works since I force the name, but how can I use as the default for input file ??