mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
272f840178
This is a part of #2717 Some settings didn't get getters because - They are transient parse settings (e.g. ignore errors) - They get propagated to args and should be checked there `is_allow_hyphen_values_set` is a curious case. In some cases, we only check the app and not an arg. This seems suspicious.
14 lines
461 B
Rust
14 lines
461 B
Rust
use clap::{app_from_crate, arg, AppSettings};
|
|
|
|
fn main() {
|
|
let matches = app_from_crate!()
|
|
.args_override_self(true)
|
|
.global_setting(AppSettings::DeriveDisplayOrder)
|
|
.allow_negative_numbers(true)
|
|
.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"));
|
|
}
|