use clap::{Parser, Subcommand};
mod commands;
mod error;
use error::Result;
#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
#[clap(subcommand)]
List(commands::list::ListCommands),
Monitor(commands::monitor::MonitorArgs),
Call(commands::call::CallArgs),
#[clap(subcommand)]
Param(commands::param::ParamCommands),
}
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
let cli = Cli::parse();
match cli.command {
Commands::List(cmd) => commands::list::execute(cmd).await?,
Commands::Monitor(args) => commands::monitor::execute(args).await?,
Commands::Call(args) => commands::call::execute(args).await?,
Commands::Param(cmd) => commands::param::execute(cmd).await?,
}
Ok(())
}