clap/examples/tutorial_derive/02_app_settings.rs

20 lines
428 B
Rust
Raw Normal View History

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 {
2022-05-21 00:52:04 +00:00
#[clap(long, value_parser)]
two: String,
2022-05-21 00:52:04 +00:00
#[clap(long, value_parser)]
one: String,
}
fn main() {
let cli = Cli::parse();
println!("two: {:?}", cli.two);
println!("one: {:?}", cli.one);
}