use clap::{arg, command, ArgAction}; fn main() { let matches = command!() // requires `cargo` feature .next_line_help(true) .arg(arg!(--two ).required(true).action(ArgAction::Set)) .arg(arg!(--one ).required(true).action(ArgAction::Set)) .get_matches(); println!( "two: {:?}", matches.get_one::("two").expect("required") ); println!( "one: {:?}", matches.get_one::("one").expect("required") ); }