Merge pull request #83664 from turbohz/fix-error-code-255-version-help

[3.x] Server: Return exit code 0 when running --version or --help
This commit is contained in:
Rémi Verschelde 2023-11-14 11:37:27 +01:00
commit b40cea8fd4
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -35,8 +35,12 @@ int main(int argc, char *argv[]) {
OS_Server os;
Error err = Main::setup(argv[0], argc - 1, &argv[1]);
if (err != OK)
if (err != OK) {
if (err == ERR_HELP) { // Returned by --help and --version, so success.
return 0;
}
return 255;
}
if (Main::start())
os.run(); // it is actually the OS that decides how to run