mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
26 lines
624 B
Rust
26 lines
624 B
Rust
use clap::{arg, Command};
|
|
|
|
fn main() {
|
|
let matches = Command::new("MyApp")
|
|
.version("1.0")
|
|
.author("Kevin K. <kbknapp@gmail.com>")
|
|
.about("Does awesome things")
|
|
.arg(arg!(--two <VALUE>))
|
|
.arg(arg!(--one <VALUE>))
|
|
.get_matches();
|
|
|
|
println!(
|
|
"two: {:?}",
|
|
matches
|
|
.get_one::<String>("two")
|
|
.expect("matches definition")
|
|
.expect("required")
|
|
);
|
|
println!(
|
|
"one: {:?}",
|
|
matches
|
|
.get_one::<String>("one")
|
|
.expect("matches definition")
|
|
.expect("required")
|
|
);
|
|
}
|