use clap::{Parser, Subcommand};
use std::path::PathBuf;
use crate::commands::{
AddCommand, AuthCommand, BuildCommand, CacheCommand, ConfigCommand, ConfigValidateArgs, DevArgs, DiagnosticsArgs,
FormatArgs, InitArgs, LintArgs, LogsCommand, ModelCommand, PsCommand, RobotCommand, RunCommand, SetupArgs,
SimCommand, StopCommand, TargetCommand, TopicsCommand, TopologyArgs, TrainArgs, UploadArgs,
};
#[derive(Parser)]
#[command(name = "mecha10")]
#[command(about = "Mecha10 CLI - Build autonomous robots with RL", long_about = None)]
#[command(version)]
pub struct Cli {
#[arg(short, long, default_value = "info", global = true)]
pub log_level: String,
#[arg(short, long, global = true)]
pub config: Option<PathBuf>,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
Add {
#[command(subcommand)]
command: AddCommand,
},
Auth {
#[command(subcommand)]
command: AuthCommand,
},
Build {
#[command(subcommand)]
command: BuildCommand,
},
Cache {
#[command(subcommand)]
command: CacheCommand,
},
Config {
#[command(subcommand)]
command: ConfigCommand,
},
Dev(#[command(flatten)] DevArgs),
Diagnostics(#[command(flatten)] DiagnosticsArgs),
Format(#[command(flatten)] FormatArgs),
Init(#[command(flatten)] InitArgs),
Lint(#[command(flatten)] LintArgs),
Logs {
#[command(subcommand)]
command: LogsCommand,
},
Model {
#[command(subcommand)]
command: ModelCommand,
},
Ps {
#[command(subcommand)]
command: PsCommand,
},
Robot {
#[command(subcommand)]
command: RobotCommand,
},
Run {
#[command(subcommand)]
command: RunCommand,
},
Setup(#[command(flatten)] SetupArgs),
Sim {
#[command(subcommand)]
command: SimCommand,
},
Stop {
#[command(subcommand)]
command: StopCommand,
},
Target {
#[command(subcommand)]
command: Option<TargetCommand>,
},
Topics {
#[command(subcommand)]
command: TopicsCommand,
},
Topology(#[command(flatten)] TopologyArgs),
Train(#[command(flatten)] TrainArgs),
Upload(#[command(flatten)] UploadArgs),
Validate(#[command(flatten)] ConfigValidateArgs),
}