]> git.proxmox.com Git - rustc.git/blob - vendor/clap-4.2.1/examples/tutorial_builder/02_crate.rs
New upstream version 1.71.1+dfsg1
[rustc.git] / vendor / clap-4.2.1 / examples / tutorial_builder / 02_crate.rs
1 use clap::{arg, command};
2
3 fn main() {
4 // requires `cargo` feature, reading name, version, author, and description from `Cargo.toml`
5 let matches = command!()
6 .arg(arg!(--two <VALUE>).required(true))
7 .arg(arg!(--one <VALUE>).required(true))
8 .get_matches();
9
10 println!(
11 "two: {:?}",
12 matches.get_one::<String>("two").expect("required")
13 );
14 println!(
15 "one: {:?}",
16 matches.get_one::<String>("one").expect("required")
17 );
18 }