1 | use clap::{command, Arg, ArgAction}; |
---|---|
2 | |
3 | fn main() { |
4 | let matches = command!() // requires `cargo` feature |
5 | .arg( |
6 | Arg::new("name") |
7 | .short('n') |
8 | .long("name") |
9 | .action(ArgAction::Append), |
10 | ) |
11 | .get_matches(); |
12 | |
13 | println!("name: {:?}", matches.get_one::<String>( "name")); |
14 | } |
15 |