2022-07-22 15:43:49 -05:00
|
|
|
use clap::{arg, command, ArgAction};
|
2021-11-30 12:30:19 -06:00
|
|
|
|
|
|
|
fn main() {
|
2022-07-19 13:29:31 -05:00
|
|
|
let matches = command!() // requires `cargo` feature
|
2022-02-10 11:51:40 -06:00
|
|
|
.allow_negative_numbers(true)
|
2022-06-06 14:55:43 -05:00
|
|
|
.arg(arg!(--two <VALUE>).action(ArgAction::Set))
|
|
|
|
.arg(arg!(--one <VALUE>).action(ArgAction::Set))
|
2021-11-30 12:30:19 -06:00
|
|
|
.get_matches();
|
|
|
|
|
2022-05-23 10:50:11 -05:00
|
|
|
println!(
|
|
|
|
"two: {:?}",
|
2022-05-25 10:46:42 -05:00
|
|
|
matches.get_one::<String>("two").expect("required")
|
2022-05-23 10:50:11 -05:00
|
|
|
);
|
|
|
|
println!(
|
|
|
|
"one: {:?}",
|
2022-05-25 10:46:42 -05:00
|
|
|
matches.get_one::<String>("one").expect("required")
|
2022-05-23 10:50:11 -05:00
|
|
|
);
|
2021-11-30 12:30:19 -06:00
|
|
|
}
|