mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 07:12:32 +00:00
21 lines
321 B
Rust
21 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);
|
|
}
|