From 75fdcbdf2b0f30d2605ddf77eaa53550ac4c29f9 Mon Sep 17 00:00:00 2001 From: ShahadatTest Date: Tue, 3 Nov 2026 08:10:30 +0600 Subject: 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) --- src/yuzu_cmd/yuzu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3