1 use clap
::{arg, command, value_parser}
;
4 let matches
= command
!() // requires `cargo` feature
7 .help("Network port to use")
8 .value_parser(value_parser
!(u16).range(1..)),
12 // Note, it's safe to call unwrap() because the arg is required
13 let port
: u16 = *matches
14 .get_one
::<u16>("PORT")
15 .expect("'PORT' is required and parsing will fail if its missing");
16 println
!("PORT = {}", port
);