Debian Codegraph @

third_party/rust/clap/examples/tutorial_derive/02_crate.rs

raw
1 use clap::Parser;
2
3 #[derive(Parser)]
4 #[command(version, about, long_about = None)] // Read from `Cargo.toml`
5 struct Cli {
6 #[arg(long)]
7 two: String,
8 #[arg(long)]
9 one: String,
10 }
11
12 fn main() {
13 let cli = Cli::parse();
14
15 println!("two: {:?}", cli.two);
16 println!("one: {:?}", cli.one);
17 }