mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
22 lines
321 B
Rust
22 lines
321 B
Rust
|
use clap::Clap;
|
||
|
|
||
|
#[derive(Clap, Debug)]
|
||
|
struct Opt {
|
||
|
#[clap(subcommand)]
|
||
|
cmd: Command,
|
||
|
}
|
||
|
|
||
|
#[derive(Clap, Debug)]
|
||
|
enum Command {
|
||
|
#[clap(external_subcommand)]
|
||
|
Run(Vec<String>),
|
||
|
|
||
|
#[clap(external_subcommand)]
|
||
|
Other(Vec<String>),
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let opt = Opt::parse();
|
||
|
println!("{:?}", opt);
|
||
|
}
|