mecha10-cli 0.6.5

Mecha10 CLI tool
Documentation
//! Build command arguments

use clap::{Args, Subcommand, ValueEnum};

/// Build subcommands
#[derive(Subcommand, Debug)]
pub enum BuildCommand {
    /// Build robot nodes (runs on the robot hardware)
    Robot(BuildTargetArgs),

    /// Build remote nodes (runs in the cloud/remote server)
    Remote(BuildTargetArgs),

    /// Build rl nodes (runs a trained RL policy in production, excludes the simulator)
    Rl(BuildTargetArgs),
}

/// Version bump type
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum VersionBump {
    /// Bump patch version (0.1.0 -> 0.1.1)
    Patch,
    /// Bump minor version (0.1.0 -> 0.2.0)
    Minor,
    /// Bump major version (0.1.0 -> 1.0.0)
    Major,
}

/// Common arguments for build targets. Always builds the release profile, so there is no
/// `--release`/`-r` flag here.
#[derive(Args, Debug, Clone)]
pub struct BuildTargetArgs {
    /// Optional target architecture for cross-compilation (cargo only). Overrides/narrows to
    /// just this one triple even if `mecha10.json`'s `targets.robot.platforms`/
    /// `targets.remote.platforms` (LAB-2152) configures multiple - when this flag is absent,
    /// every triple listed there is built.
    #[arg(short, long)]
    pub target: Option<String>,

    /// Bump version before building (patch, minor, major)
    #[arg(long, value_enum, conflicts_with = "version")]
    pub bump: Option<VersionBump>,

    /// Set specific version before building (e.g., 1.2.3)
    #[arg(long, conflicts_with = "bump")]
    pub version: Option<String>,

    /// Build with dev environment (default is production for builds)
    #[arg(long)]
    pub dev: bool,

    /// Skip interactive prompts (e.g. the already-published-version bump prompt) - just warn and
    /// proceed. Matches `mecha10 init`'s `--non-interactive` convention, for use in CI/scripts.
    #[arg(long)]
    pub non_interactive: bool,
}