clap/examples/tutorial_derive/02_apps.rs

21 lines
422 B
Rust
Raw Normal View History

use clap::Parser;
#[derive(Parser)]
#[clap(name = "MyApp")]
#[clap(author = "Kevin K. <kbknapp@gmail.com>")]
#[clap(version = "1.0")]
#[clap(about = "Does awesome things", long_about = None)]
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);
}