1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Build command arguments
use clap::{Args, Subcommand, ValueEnum};
#[derive(Subcommand, Debug)]
pub enum BuildCommand {
Robot(BuildTargetArgs),
Remote(BuildTargetArgs),
Rl(BuildTargetArgs),
}
#[derive(Debug, Clone, Copy, ValueEnum)]
pub enum VersionBump {
Patch,
Minor,
Major,
}
/// Where a `mecha10 build` invocation actually runs the compile (LAB-5442, part of the
/// "build via mecha10 dashboard" feature, LAB-2153): on this machine (the long-standing
/// behavior), or uploaded to the mecha10 dashboard/platform for a remote/cloud build.
/// Deliberately a separate axis from `BuildTargetArgs::target`/`BuildCommand`'s
/// `robot`/`remote`/`rl` choice (which node class to build *for*), not a new variant of it -
/// a dashboard build can be requested for any of those.
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub enum BuildLocation {
Local,
Dashboard,
}
#[derive(Args, Debug, Clone)]
pub struct BuildTargetArgs {
#[arg(short, long)]
pub target: Option<String>,
#[arg(long, value_enum, conflicts_with = "version")]
pub bump: Option<VersionBump>,
#[arg(long, conflicts_with = "bump")]
pub version: Option<String>,
#[arg(long)]
pub dev: bool,
#[arg(long)]
pub non_interactive: bool,
/// Build locally or upload the project to the mecha10 dashboard for a remote build.
/// Prompted interactively when omitted and the terminal is interactive; defaults to
/// `local` otherwise (LAB-5442).
#[arg(long, value_enum)]
pub location: Option<BuildLocation>,
}