mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-05 23:23:25 +02:00
with type filtering
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use crate::cli_generate;
|
||||
|
||||
pub struct Cli {
|
||||
cmd: clap::Command,
|
||||
}
|
||||
@@ -7,7 +9,7 @@ impl Cli {
|
||||
Ok(Self {
|
||||
cmd: clap::Command::new("dagger-rust")
|
||||
.subcommand_required(true)
|
||||
.subcommand(clap::Command::new("generate")),
|
||||
.subcommand(cli_generate::GenerateCommand::new_cmd()),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,8 +17,10 @@ impl Cli {
|
||||
let matches = self.cmd.get_matches_from(args);
|
||||
|
||||
match matches.subcommand() {
|
||||
Some(("generate", _args)) => Ok(()),
|
||||
Some(("generate", args)) => cli_generate::GenerateCommand::exec(args)?,
|
||||
_ => eyre::bail!("command missing"),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user