Ability to know whether a short option or long option was used #2213
-
Currently for the built-in More specifically I want to output something different for |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can set an arg with |
Beta Was this translation helpful? Give feedback.
-
Could you give an example. What I want is a single Arg with For example in the following example: use clap::{App, AppSettings, Arg};
fn main() {
let matches = App::new("test")
.setting(AppSettings::NoAutoVersion)
.arg(Arg::new("version").long("version").short('V'))
.get_matches();
println!("{:?}", matches.is_present("version"));
} Is it possible for me to know if it was |
Beta Was this translation helpful? Give feedback.
You can set an arg with
-V
short which overrides the short of the built in version flag.