pub mod config;
pub mod address;
pub mod port;
pub mod spawn;
pub mod kill;
use clap::Subcommand;
#[derive(Subcommand)]
pub enum Commands {
Config {
#[command(subcommand)]
command: config::Commands,
},
Address {
#[command(subcommand)]
command: address::Commands,
},
Port {
#[command(subcommand)]
command: port::Commands,
},
Spawn,
Kill,
}
impl Commands {
pub async fn handle(
self,
cli_config: &crate::Config,
handle: &objectiveai_sdk::cli::output::Handle,
) -> Result<(), crate::error::Error> {
match self {
Commands::Config { command } => command.handle(cli_config, handle).await,
Commands::Address { command } => command.handle(cli_config, handle).await,
Commands::Port { command } => command.handle(cli_config, handle).await,
Commands::Spawn => spawn::handle(cli_config, handle).await,
Commands::Kill => kill::handle(cli_config, handle).await,
}
}
}