2022-02-11 21:48:29 -06:00
|
|
|
use clap::{arg, Command};
|
2021-11-30 12:30:19 -06:00
|
|
|
|
|
|
|
fn main() {
|
2022-02-11 21:48:29 -06:00
|
|
|
let matches = Command::new("MyApp")
|
2021-11-30 12:30:19 -06:00
|
|
|
.version("1.0")
|
|
|
|
.author("Kevin K. <kbknapp@gmail.com>")
|
|
|
|
.about("Does awesome things")
|
2022-09-12 16:59:57 -05:00
|
|
|
.arg(arg!(--two <VALUE>).required(true))
|
|
|
|
.arg(arg!(--one <VALUE>).required(true))
|
2021-11-30 12:30:19 -06:00
|
|
|
.get_matches();
|
|
|
|
|
2022-05-23 10:50:11 -05:00
|
|
|
println!(
|
|
|
|
"two: {:?}",
|
2022-05-25 10:46:42 -05:00
|
|
|
matches.get_one::<String>("two").expect("required")
|
2022-05-23 10:50:11 -05:00
|
|
|
);
|
|
|
|
println!(
|
|
|
|
"one: {:?}",
|
2022-05-25 10:46:42 -05:00
|
|
|
matches.get_one::<String>("one").expect("required")
|
2022-05-23 10:50:11 -05:00
|
|
|
);
|
2021-11-30 12:30:19 -06:00
|
|
|
}
|