]>
git.proxmox.com Git - rustc.git/blob - vendor/clap/examples/cargo-example.rs
1 // Note: this requires the `cargo` feature
4 let cmd
= clap
::Command
::new("cargo")
6 .subcommand_required(true)
8 clap
::command
!("example").arg(
9 clap
::arg
!(--"manifest-path" <PATH
>)
11 .allow_invalid_utf8(true),
14 let matches
= cmd
.get_matches();
15 let matches
= match matches
.subcommand() {
16 Some(("example", matches
)) => matches
,
17 _
=> unreachable
!("clap should ensure we don't get here"),
19 let manifest_path
= matches
20 .value_of_os("manifest-path")
21 .map(std
::path
::PathBuf
::from
);
22 println
!("{:?}", manifest_path
);