aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
-rw-r--r--apps/fparkan-game/src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs
index cfae3ffb..2129f82c 100644
--- a/apps/fparkan-game/src/main.rs
+++ b/apps/fparkan-game/src/main.rs
@@ -11557,7 +11557,11 @@ impl Args {
_ => return Err(usage()),
}
}
- let root = root.ok_or_else(|| "missing --root".to_string())?;
+ let root = match root {
+ Some(root) => root,
+ None => std::env::current_dir()
+ .map_err(|error| format!("cannot resolve the game data directory: {error}"))?,
+ };
let mission = match (list_missions, mission) {
(true, None) if sim_report_ms.is_none() => String::new(),
(true, _) => {
@@ -11612,7 +11616,7 @@ impl Args {
}
fn usage() -> String {
- "usage: fparkan-game --root <path> --list-missions\n fparkan-game --root <path> --mission <number|path> --sim-report <seconds>\n fparkan-game --root <path> --mission <number|path> [--build-scheme <Unit DAT path> [--build-part OLD=NEW]...] [--viewer] [--frames <n>] [--atmosphere-seconds <seconds>] [--control-clock-ms <u32>] [--validation] [--preview-roots <non-zero n>] [--legacy-camera-capture <path>] [--static-animation-frame <u16>] [--static-material-phase <u16>] [--readback-out <path>] [--readback-sequence-out <directory>]\n--viewer skips mission simulation. Capture, static pose/material and root-limit options select viewer mode. --control-clock-ms replays the scene clock from zero to the selected time over the requested frames; --readback-sequence-out captures each submitted frame and requires that clock.".to_string()
+ "usage: fparkan-game [--root <path>] --list-missions\n fparkan-game [--root <path>] --mission <number|path> --sim-report <seconds>\n fparkan-game [--root <path>] --mission <number|path> [--build-scheme <Unit DAT path> [--build-part OLD=NEW]...] [--viewer] [--frames <n>] [--atmosphere-seconds <seconds>] [--control-clock-ms <u32>] [--validation] [--preview-roots <non-zero n>] [--legacy-camera-capture <path>] [--static-animation-frame <u16>] [--static-material-phase <u16>] [--readback-out <path>] [--readback-sequence-out <directory>]\nWithout --root, game data is read from the working directory.\n--viewer skips mission simulation. Capture, static pose/material and root-limit options select viewer mode. --control-clock-ms replays the scene clock from zero to the selected time over the requested frames; --readback-sequence-out captures each submitted frame and requires that clock.".to_string()
}
#[cfg(test)]