2021-07-13 17:50:55 +00:00
|
|
|
use clap::Parser;
|
2020-04-30 17:20:21 +00:00
|
|
|
|
2021-07-13 17:50:55 +00:00
|
|
|
#[derive(Parser, Debug)]
|
2020-04-30 17:20:21 +00:00
|
|
|
struct Opt {
|
2022-09-02 19:20:39 +00:00
|
|
|
#[command(subcommand)]
|
2020-04-30 17:20:21 +00:00
|
|
|
cmd: Command,
|
|
|
|
}
|
|
|
|
|
2021-07-13 17:50:55 +00:00
|
|
|
#[derive(Parser, Debug)]
|
2020-04-30 17:20:21 +00:00
|
|
|
enum Command {
|
2022-09-02 19:20:39 +00:00
|
|
|
#[command(external_subcommand)]
|
2020-04-30 17:20:21 +00:00
|
|
|
Run(Vec<String>),
|
|
|
|
|
2022-09-02 19:20:39 +00:00
|
|
|
#[command(external_subcommand)]
|
2020-04-30 17:20:21 +00:00
|
|
|
Other(Vec<String>),
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let opt = Opt::parse();
|
2023-05-04 19:53:36 +00:00
|
|
|
println!("{opt:?}");
|
2020-04-30 17:20:21 +00:00
|
|
|
}
|