From 545ee0840b9d83f54a3c5645057490b99699cdfd Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Mon, 27 Jun 2022 20:30:00 +0200 Subject: [PATCH] Initialize QCoreApplication before calling showHelp --- assignment-client/src/AssignmentClientApp.cpp | 1 + domain-server/src/DomainServer.cpp | 1 + interface/src/main.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/assignment-client/src/AssignmentClientApp.cpp b/assignment-client/src/AssignmentClientApp.cpp index 36e44b82a6..d0e8eb2e0d 100644 --- a/assignment-client/src/AssignmentClientApp.cpp +++ b/assignment-client/src/AssignmentClientApp.cpp @@ -130,6 +130,7 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : auto &logHandler = LogHandler::getInstance(); if (parser.isSet(logOption)) { if (!logHandler.parseOptions(parser.value(logOption).toUtf8())) { + QCoreApplication mockApp(argc, const_cast(argv)); // required for call to showHelp() parser.showHelp(); Q_UNREACHABLE(); } diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 1a139530fe..0cf99c8d05 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -443,6 +443,7 @@ void DomainServer::parseCommandLine(int argc, char* argv[]) { auto &logHandler = LogHandler::getInstance(); if (parser.isSet(logOption)) { if (!logHandler.parseOptions(parser.value(logOption).toUtf8())) { + QCoreApplication mockApp(argc, const_cast(argv)); // required for call to showHelp() parser.showHelp(); Q_UNREACHABLE(); } diff --git a/interface/src/main.cpp b/interface/src/main.cpp index a90c06df5a..4bc0d7743a 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -312,6 +312,7 @@ int main(int argc, const char* argv[]) { auto &logHandler = LogHandler::getInstance(); if (parser.isSet(logOption)) { if (!logHandler.parseOptions(parser.value(logOption).toUtf8())) { + QCoreApplication mockApp(argc, const_cast(argv)); // required for call to showHelp() parser.showHelp(); Q_UNREACHABLE(); }