| 1 | use clap::{arg, Command}; |
|---|---|
| 2 | |
| 3 | fn main() { |
| 4 | let matches = Command::new("MyApp") |
| 5 | .version("1.0") |
| 6 | .author("Kevin K. <kbknapp@gmail.com>") |
| 7 | .about("Does awesome things") |
| 8 | .arg(arg!(--two <VALUE>).required(true)) |
| 9 | .arg(arg!(--one <VALUE>).required(true)) |
| 10 | .get_matches(); |
| 11 | |
| 12 | println!( |
| 13 | "two: {:?}", |
| 14 | matches.get_one::<String>("two").expect( "required") |
| 15 | ); |
| 16 | println!( |
| 17 | "one: {:?}", |
| 18 | matches.get_one::<String>("one").expect( "required") |
| 19 | ); |
| 20 | } |
| 21 |
