mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
1428785677
This shouldn't be needed anymore now that this is effectively the new behavior for the non-deprecated actions. This was briefly talked about in https://github.com/clap-rs/clap/discussions/2627 but I wasn't familiar enough with the implementation to know how safe it is. Now, maintainrs and users can be more confident because they are explicitly opting into it. See also #3795
19 lines
428 B
Rust
19 lines
428 B
Rust
use clap::{AppSettings, Parser};
|
|
|
|
#[derive(Parser)]
|
|
#[clap(author, version, about, long_about = None)]
|
|
#[clap(allow_negative_numbers = true)]
|
|
#[clap(global_setting(AppSettings::DeriveDisplayOrder))]
|
|
struct Cli {
|
|
#[clap(long, value_parser)]
|
|
two: String,
|
|
#[clap(long, value_parser)]
|
|
one: String,
|
|
}
|
|
|
|
fn main() {
|
|
let cli = Cli::parse();
|
|
|
|
println!("two: {:?}", cli.two);
|
|
println!("one: {:?}", cli.one);
|
|
}
|