cuddle-v2/crates/cuddle/src/cli/init_command.rs
kjuulh db49af5fa2
feat: WIP setup actions
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-10-24 22:59:27 +02:00

32 lines
688 B
Rust

use clap::Parser;
use rust_action::RustAction;
use crate::{cuddle_state::Cuddle, state::ValidatedState};
pub mod rust_action;
#[derive(Parser, Debug)]
#[command(subcommand_required = true)]
pub struct InitCommand {
#[clap(subcommand)]
commands: InitCommands,
}
#[derive(clap::Parser, Debug)]
pub enum InitCommands {
#[clap(name = "actions:rust")]
RustAction(RustAction),
}
impl InitCommand {
pub async fn execute(&self, cuddle: &Cuddle<ValidatedState>) -> anyhow::Result<()> {
match &self.commands {
InitCommands::RustAction(rust_action) => {
rust_action.execute(cuddle).await?;
}
}
Ok(())
}
}