clap/examples/tutorial_builder/02_app_settings.rs
Ed Page 11076a5c70 fix(help)!: Make DeriveDisplayOrder the default, removing it
Force sorting with `next_display_order(None)`

Fixes #2808
2022-07-22 15:52:03 -05:00

18 lines
490 B
Rust

use clap::{arg, command, ArgAction};
fn main() {
let matches = command!() // requires `cargo` feature
.allow_negative_numbers(true)
.arg(arg!(--two <VALUE>).action(ArgAction::Set))
.arg(arg!(--one <VALUE>).action(ArgAction::Set))
.get_matches();
println!(
"two: {:?}",
matches.get_one::<String>("two").expect("required")
);
println!(
"one: {:?}",
matches.get_one::<String>("one").expect("required")
);
}