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