diff options
| author | ShahadatTest <Shahadattgbd@gmail.com> | 2026-11-03 08:10:30 +0600 |
|---|---|---|
| committer | nagisa-kamishiro <83013268+nagisa-kamishiro@users.noreply.github.com> | 2026-11-03 14:26:40 +0900 |
| commit | 75fdcbdf2b0f30d2605ddf77eaa53550ac4c29f9 (patch) | |
| tree | 495ff08dd81a96aab94311347c2be972476d5f87 | |
| parent | 68a945d0a84fca00545df0fe7b8fe714436242a5 (diff) | |
cli: exit successfully for --help and --version
ApplyLaunchParams already prints the help or version text, but
SDL_AppInit then fell through to the "No ROM specified" check and
returned SDL_APP_FAILURE, so `eglantine-cli --help` and `--version`
logged a critical error and exited with a failure code. Return
SDL_APP_SUCCESS for those two options before the ROM check.
Tested: Windows and Linux CI builds; on Windows, --help and --version
exit with 0 and running without a ROM still exits with a failure.
AI disclosure: implemented with Claude and reviewed with Codex (AI
coding assistants).
(cherry picked from commit 6debe97d22)
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 6342c5d353..86530ea798 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -349,6 +349,12 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { return PackNup(*lp.pack_nup_source, lp.filepath) ? SDL_APP_SUCCESS : SDL_APP_FAILURE; } + // Informational options already printed by ApplyLaunchParams; do not treat a + // missing ROM as a failure when the user only asked for help or version. + if (lp.print_help || lp.print_version) { + return SDL_APP_SUCCESS; + } + if (lp.filepath.empty()) { LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return SDL_APP_FAILURE; |
