mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
FIX(cli, server): Proper exit code handling
This commit is contained in:
parent
0d67afd3f8
commit
9fdd52adde
@ -213,6 +213,7 @@ extern HWND mumble_mw_hwnd;
|
||||
|
||||
|
||||
struct CLIOptions {
|
||||
int exitCode = 0;
|
||||
bool allowMultiple = false;
|
||||
bool suppressIdentity = false;
|
||||
bool rpcMode = false;
|
||||
@ -364,7 +365,8 @@ CLIOptions parseCLI(int argc, char **argv) {
|
||||
} else {
|
||||
qInfo("%s", info_stream.str().c_str());
|
||||
}
|
||||
options.quit = true;
|
||||
options.quit = true;
|
||||
options.exitCode = e.get_exit_code();
|
||||
}
|
||||
|
||||
return options;
|
||||
@ -405,7 +407,7 @@ int main(int argc, char **argv) {
|
||||
CLIOptions options = parseCLI(argc, argv);
|
||||
|
||||
if (options.quit) {
|
||||
return 0;
|
||||
return options.exitCode;
|
||||
}
|
||||
|
||||
// This argument has to be parsed first, since it's value is needed to create the global struct,
|
||||
|
||||
@ -193,6 +193,7 @@ void cleanup(int signum) {
|
||||
}
|
||||
|
||||
struct CLIOptions {
|
||||
int exitCode = 0;
|
||||
bool quit = false;
|
||||
std::optional< std::string > iniFile;
|
||||
std::optional< std::string > dbDumpPath;
|
||||
@ -315,6 +316,8 @@ CLIOptions parseCLI(int argc, char **argv) {
|
||||
std::cout << info_stream.str();
|
||||
}
|
||||
|
||||
options.quit = true;
|
||||
options.exitCode = e.get_exit_code();
|
||||
}
|
||||
|
||||
return options;
|
||||
@ -376,7 +379,7 @@ int main(int argc, char **argv) {
|
||||
#endif
|
||||
CLIOptions cli_options = parseCLI(argc, argv);
|
||||
if (cli_options.quit)
|
||||
return 0;
|
||||
return cli_options.exitCode;
|
||||
|
||||
if (cli_options.printLicense) {
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
Loading…
Reference in New Issue
Block a user