From cc9dd00e1a4fa4472a2bf788e97f0030bcecc9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 2 Jul 2022 00:07:14 +0200 Subject: [PATCH] Revert "Command line arguments '--version' and '--help' return exit code 0 instead of 255" This reverts commit 9e165a8c2b205f37564e7e0e3e96c1fce52b6622. See https://github.com/godotengine/godot/pull/62550#issuecomment-1172745325. --- main/main.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 13830937aab..f0734e2e839 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -478,9 +478,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph packed_data->add_pack_source(zip_packed_data); #endif - // Default exit code, can be modified for certain errors. - Error exit_code = ERR_INVALID_PARAMETER; - I = args.front(); while (I) { #ifdef OSX_ENABLED @@ -497,12 +494,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help show_help = true; - exit_code = OK; goto error; } else if (I->get() == "--version") { print_line(get_full_version_string()); - exit_code = OK; goto error; } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output @@ -1333,7 +1328,7 @@ error: OS::get_singleton()->finalize_core(); locale = String(); - return exit_code; + return ERR_INVALID_PARAMETER; } Error Main::setup2(Thread::ID p_main_tid_override) {