mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 07:12:32 +00:00
11 lines
246 B
Rust
11 lines
246 B
Rust
// Note: this requires the `cargo` feature
|
|
|
|
use clap::{arg, command};
|
|
|
|
fn main() {
|
|
let matches = command!()
|
|
.arg(arg!(-n --name <NAME>).required(false))
|
|
.get_matches();
|
|
|
|
println!("name: {:?}", matches.value_of("name"));
|
|
}
|