diff options
author | 2016-12-16 18:12:33 +0100 | |
---|---|---|
committer | 2016-12-16 18:12:33 +0100 | |
commit | 0e3504774e4a889a3836c2eb2e02f4d38d3dc9b1 (patch) | |
tree | 3472ae62d578553a6c85fe69c2dbb95ae5898e82 /WindowManager/src | |
parent | 1edc5d1bebfd4156b0b58d693f0431d17f20a508 (diff) |
Add parameter "quiet" to suppress outputs
This will disable all debug outputs. All!
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
Diffstat (limited to 'WindowManager/src')
-rw-r--r-- | WindowManager/src/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/WindowManager/src/main.cpp b/WindowManager/src/main.cpp index 5af8be1..c578b47 100644 --- a/WindowManager/src/main.cpp +++ b/WindowManager/src/main.cpp @@ -18,6 +18,11 @@ #include <QCommandLineParser> #include "windowmanager.hpp" + +void noOutput(QtMsgType, const QMessageLogContext &, const QString &) +{ +} + int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); @@ -31,12 +36,20 @@ int main(int argc, char *argv[]) parser.setApplicationDescription("AGL WindowManager - see wwww... for more details"); parser.addHelpOption(); parser.addVersionOption(); + QCommandLineOption quietOption(QStringList() << "q" << "quiet", + QCoreApplication::translate("main", "Be quiet. No outputs.")); + parser.addOption(quietOption); QCommandLineOption displayOption(QStringList() << "d" << "display-id", QCoreApplication::translate("main", "The display with this <id> to manage. Default=0"), QCoreApplication::translate("main", "id")); parser.addOption(displayOption); parser.process(a); + if (parser.isSet(quietOption)) + { + qInstallMessageHandler(noOutput); + } + int displayId = 0; if (parser.isSet(displayOption)) { |