1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use clap::Parser;
#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(short = 'f', action)]
eff: bool,
#[clap(short = 'p', value_name = "PEAR", value_parser)]
pea: Option<String>,
#[clap(last = true, value_parser)]
slop: Vec<String>,
}
fn main() {
let args = Cli::parse();
println!("-f used: {:?}", args.eff);
println!("-p's value: {:?}", args.pea);
println!("'slops' values: {:?}", args.slop);
}