mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
11076a5c70
Force sorting with `next_display_order(None)` Fixes #2808
18 lines
490 B
Rust
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")
|
|
);
|
|
}
|