]> git.proxmox.com Git - rustc.git/blob - vendor/clap/examples/tutorial_derive/04_02_parse.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / vendor / clap / examples / tutorial_derive / 04_02_parse.rs
1 use clap::Parser;
2
3 #[derive(Parser)]
4 #[clap(author, version, about, long_about = None)]
5 struct Cli {
6 /// Network port to use
7 #[clap(value_parser = clap::value_parser!(u16).range(1..))]
8 port: u16,
9 }
10
11 fn main() {
12 let cli = Cli::parse();
13
14 println!("PORT = {}", cli.port);
15 }