1 // Copyright 2018 Guillaume Pinot (@TeXitoi) <texitoi@texitoi.eu>
2 //
3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6 // option. This file may not be copied, modified, or distributed
7 // except according to those terms.
8
9 use clap::Parser;
10
11 #[derive(Debug)]
12 enum Kind {
13 A,
14 B,
15 }
16
17 #[derive(Parser, Debug)]
18 #[command(name = "test")]
19 pub struct Opt {
20 #[arg(short)]
21 number: u32,
22 #[arg(skip)]
23 k: Kind,
24 }
25
main()26 fn main() {
27 let opt = Opt::parse();
28 println!("{:?}", opt);
29 }
30