with type filtering

This commit is contained in:
2023-01-28 20:21:19 +01:00
parent 3eb891422f
commit 2eb5d98c8a
8 changed files with 4763 additions and 4 deletions

View File

@@ -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(())
}
}