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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
use clap::{Args, Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(name = "infinity-msfs")]
#[command(version)]
#[command(about = "MSFS WASM build tooling for Infinity Rust projects")]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
Build(BuildArgs),
#[command(alias = "list-projects")]
Projects(ProjectsArgs),
/// Manage the local MSFS 2024 SDK installation.
Sdk(SdkArgs),
/// Run pre-flight checks for the build environment.
Doctor,
}
#[derive(Debug, Args, Clone)]
pub struct BuildArgs {
#[arg(long)]
pub release: bool,
/// Stream subprocess output directly instead of the compact progress UI.
#[arg(short = 'v', long)]
pub verbose: bool,
/// Override the single legacy `[build].package`. Ignored when
/// `[[packages]]` is set and `--only` is preferred there.
#[arg(short = 'p', long = "package")]
pub package: Option<String>,
/// In multi-package mode, restrict the build to the named packages.
/// May be passed multiple times. Matched against the `package` field
/// of each `[[packages]]` entry.
#[arg(long = "only")]
pub only: Vec<String>,
#[arg(long = "no-wasm-opt")]
pub no_wasm_opt: bool,
}
#[derive(Debug, Args, Clone)]
pub struct SdkArgs {
#[command(subcommand)]
pub command: SdkCommand,
}
#[derive(Debug, Subcommand, Clone)]
pub enum SdkCommand {
/// Download the latest MSFS 2024 SDK from sdk.flightsimulator.com and
/// extract the relevant subtree into the local cache.
Install(SdkInstallArgs),
/// Print the resolved SDK path.
Path,
/// Remove the cached SDK installation.
Remove,
}
#[derive(Debug, Args, Clone)]
pub struct SdkInstallArgs {
/// Re-download even if the latest version is already cached.
#[arg(long)]
pub force: bool,
}
#[derive(Debug, Args, Clone)]
pub struct ProjectsArgs {
/// Override the single legacy `[build].package`. Ignored when
/// `[[packages]]` is set and `--only` is preferred there.
#[arg(short = 'p', long = "package")]
pub package: Option<String>,
/// In multi-package mode, restrict the list to the named packages.
/// May be passed multiple times. Matched against the `package` field
/// of each `[[packages]]` entry.
#[arg(long = "only")]
pub only: Vec<String>,
}