Skip to content

Commit

Permalink
Revert "Command line arguments '--version' and '--help' return exit c…
Browse files Browse the repository at this point in the history
…ode 0 instead of 255"

This reverts commit 9e165a8.
See godotengine#62550 (comment).
  • Loading branch information
akien-mga authored and Riordan-DC committed Jan 23, 2023
1 parent f08e5ef commit 3217c20
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1333,7 +1328,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->finalize_core();
locale = String();

return exit_code;
return ERR_INVALID_PARAMETER;
}

Error Main::setup2(Thread::ID p_main_tid_override) {
Expand Down

0 comments on commit 3217c20

Please sign in to comment.