2022-03-03 18:32:29 +00:00
|
|
|
// Note: this requires the `cargo` feature
|
|
|
|
|
2022-02-15 14:33:38 +00:00
|
|
|
use clap::{arg, command, AppSettings};
|
2021-11-30 18:30:19 +00:00
|
|
|
|
|
|
|
fn main() {
|
2022-02-15 14:33:38 +00:00
|
|
|
let matches = command!()
|
2022-02-10 17:51:40 +00:00
|
|
|
.args_override_self(true)
|
2021-11-30 18:30:19 +00:00
|
|
|
.global_setting(AppSettings::DeriveDisplayOrder)
|
2022-02-10 17:51:40 +00:00
|
|
|
.allow_negative_numbers(true)
|
2021-11-30 18:30:19 +00:00
|
|
|
.arg(arg!(--two <VALUE>))
|
|
|
|
.arg(arg!(--one <VALUE>))
|
|
|
|
.get_matches();
|
|
|
|
|
|
|
|
println!("two: {:?}", matches.value_of("two").expect("required"));
|
|
|
|
println!("one: {:?}", matches.value_of("one").expect("required"));
|
|
|
|
}
|