clap/examples/tutorial_builder/03_02_option.rs

10 lines
216 B
Rust
Raw Normal View History

use clap::{app_from_crate, arg};
fn main() {
let matches = app_from_crate!()
.arg(arg!(-n --name <NAME>).required(false))
.get_matches();
println!("name: {:?}", matches.value_of("name"));
}