upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/main.cpp
diff options
context:
space:
mode:
authorFelix Croasdale <205819305+etcetera-yt@users.noreply.github.com>2026-11-21 22:59:33 -0600
committerFelix Croasdale <205819305+etcetera-yt@users.noreply.github.com>2026-11-21 23:01:31 -0600
commit08b8dc793f22b6dab2f56d50c993602dcab53afb (patch)
tree66e083a27f3825627acfcf1e1ebd1a7d894097ed /runtime/src/main.cpp
parent067d3e8b97189fcf272dc699fdbb871eae496660 (diff)
gta6rt: refuse more than one of --dry-run, --init and --run (#886)
--dry-run --run set both flags, so the dry run initialised the modules and called the entry point. gta6rt now takes exactly one mode and prints the usage (exit 2) otherwise. Three ctest cases run the stand-in game with two modes and fail if it is mapped or run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/main.cpp')
-rw-r--r--runtime/src/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp
index 20c870377..c0248e819 100644
--- a/runtime/src/main.cpp
+++ b/runtime/src/main.cpp
@@ -65,7 +65,8 @@ int wmain(int argc, wchar_t** argv) {
65 else return usage(); 65 else return usage();
66 } 66 }
67 if (image.empty()) return usage(); 67 if (image.empty()) return usage();
68 if (!dry_run && !init && !run) return usage(); 68 // Exactly one mode: --dry-run --run would otherwise initialise the modules and call the entry point.
69 if (dry_run + init + run != 1) return usage();
69 if (game_dir.empty()) game_dir = image.parent_path(); 70 if (game_dir.empty()) game_dir = image.parent_path();
70 rt::d3d12_trace::set_enabled(trace_d3d12); 71 rt::d3d12_trace::set_enabled(trace_d3d12);
71 72