diff options
Diffstat (limited to 'vendor/clap/examples/tutorial_builder/03_02_option_mult.rs')
-rw-r--r-- | vendor/clap/examples/tutorial_builder/03_02_option_mult.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/clap/examples/tutorial_builder/03_02_option_mult.rs b/vendor/clap/examples/tutorial_builder/03_02_option_mult.rs new file mode 100644 index 000000000..1370477eb --- /dev/null +++ b/vendor/clap/examples/tutorial_builder/03_02_option_mult.rs @@ -0,0 +1,14 @@ +use clap::{command, Arg, ArgAction}; + +fn main() { + let matches = command!() // requires `cargo` feature + .arg( + Arg::new("name") + .short('n') + .long("name") + .action(ArgAction::Append), + ) + .get_matches(); + + println!("name: {:?}", matches.get_one::<String>("name")); +} |