]>
git.proxmox.com Git - rustc.git/blob - vendor/clap/examples/tutorial_builder/04_02_parse.rs
1 use clap
::{arg, command}
;
4 let matches
= command
!()
7 .help("Network port to use")
8 .validator(|s
| s
.parse
::<usize>()),
12 // Note, it's safe to call unwrap() because the arg is required
13 let port
: usize = matches
15 .expect("'PORT' is required and parsing will fail if its missing");
16 println
!("PORT = {}", port
);