pub mod build;
pub mod install;
pub mod new;
pub mod run;
use crate::error::Result;
use clap::Parser;
use crossbundle_tools::types::Config;
#[derive(Parser, Clone, Debug)]
pub enum Commands {
#[clap(subcommand)]
Build(build::BuildCommand),
#[clap(subcommand)]
Run(run::RunCommand),
New(new::NewCommand),
Install(install::InstallCommand),
}
impl Commands {
pub fn handle_command(&self, config: &Config) -> Result<()> {
match self {
Commands::Build(cmd) => cmd.handle_command(config),
Commands::Run(cmd) => cmd.handle_command(config),
Commands::New(cmd) => cmd.handle_command(config),
Commands::Install(cmd) => cmd.handle_command(config),
}
}
}