mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
21 lines
336 B
Rust
21 lines
336 B
Rust
use clap::Parser;
|
|
|
|
#[derive(Parser, Debug)]
|
|
struct Opt {
|
|
#[command(subcommand)]
|
|
cmd: Command,
|
|
}
|
|
|
|
#[derive(Parser, Debug)]
|
|
enum Command {
|
|
#[command(external_subcommand)]
|
|
Run(Vec<String>),
|
|
|
|
#[command(external_subcommand)]
|
|
Other(Vec<String>),
|
|
}
|
|
|
|
fn main() {
|
|
let opt = Opt::parse();
|
|
println!("{:?}", opt);
|
|
}
|