]> git.proxmox.com Git - rustc.git/blob - vendor/clap/examples/cargo-example-derive.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / vendor / clap / examples / cargo-example-derive.rs
1 // Note: this requires the `derive` feature
2
3 use clap::Parser;
4
5 #[derive(Parser)]
6 #[clap(name = "cargo")]
7 #[clap(bin_name = "cargo")]
8 enum Cargo {
9 ExampleDerive(ExampleDerive),
10 }
11
12 #[derive(clap::Args)]
13 #[clap(author, version, about, long_about = None)]
14 struct ExampleDerive {
15 #[clap(long, value_parser)]
16 manifest_path: Option<std::path::PathBuf>,
17 }
18
19 fn main() {
20 let Cargo::ExampleDerive(args) = Cargo::parse();
21 println!("{:?}", args.manifest_path);
22 }