now attaches to parent console on windows

This commit is contained in:
fourtf
2021-03-13 12:14:40 +01:00
parent baddb60bb9
commit 4ff2de0567
4 changed files with 23 additions and 1 deletions
+12 -1
View File
@@ -7,6 +7,7 @@
#include "common/QLogging.hpp"
#include "singletons/Paths.hpp"
#include "singletons/WindowManager.hpp"
#include "util/AttachToConsole.hpp"
#include "util/CombinePath.hpp"
#include "widgets/Window.hpp"
@@ -26,10 +27,17 @@ Args::Args(const QApplication &app)
QCommandLineOption parentWindowOption("parent-window");
parentWindowOption.setFlags(QCommandLineOption::HiddenFromHelp);
// Verbose
QCommandLineOption verboseOption({{"v", "verbose"},
"Attaches to the Console on windows, "
"allowing you to see debug output."});
crashRecoveryOption.setFlags(QCommandLineOption::HiddenFromHelp);
parser.addOptions({
{{"V", "version"}, "Displays version information."},
crashRecoveryOption,
parentWindowOption,
verboseOption,
});
parser.addOption(QCommandLineOption(
{"c", "channels"},
@@ -46,6 +54,7 @@ Args::Args(const QApplication &app)
if (parser.isSet("help"))
{
attachToConsole();
qInfo().noquote() << parser.helpText();
::exit(EXIT_SUCCESS);
}
@@ -60,7 +69,9 @@ Args::Args(const QApplication &app)
this->applyCustomChannelLayout(parser.value("c"));
}
this->printVersion = parser.isSet("v");
this->verbose = parser.isSet(verboseOption);
this->printVersion = parser.isSet("V");
this->crashRecovery = parser.isSet("crash-recovery");
}