32 lines
688 B
Rust
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(())
|
|
}
|
|
}
|