clap/examples/tutorial_derive/02_crate.rs

18 lines
317 B
Rust
Raw Normal View History

use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about, 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);
}