mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-04 22:53:26 +02:00
Add base sdk
This commit is contained in:
22
src/cli.rs
Normal file
22
src/cli.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
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"),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user