mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-29 10:12:27 +01:00
23 lines
558 B
Rust
23 lines
558 B
Rust
pub struct Cli {
|
|
cmd: clap::Command,
|
|
}
|
|
|
|
impl Cli {
|
|
pub fn new() -> eyre::Result<Self> {
|
|
Ok(Self {
|
|
cmd: clap::Command::new("dagger-rust")
|
|
.subcommand_required(true)
|
|
.subcommand(clap::Command::new("generate")),
|
|
})
|
|
}
|
|
|
|
pub fn execute(self, args: &[&str]) -> eyre::Result<()> {
|
|
let matches = self.cmd.get_matches_from(args);
|
|
|
|
match matches.subcommand() {
|
|
Some(("generate", _args)) => Ok(()),
|
|
_ => eyre::bail!("command missing"),
|
|
}
|
|
}
|
|
}
|