Add 2017 to copyright
[staging/HomeScreen.git] / InputEventManager / src / main.cpp
index 1025bc3..f710cb4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 #include <QCoreApplication>
+#include <QCommandLineParser>
 #include "inputeventmanager.h"
 
+void noOutput(QtMsgType, const QMessageLogContext &, const QString &)
+{
+}
+
 int main(int argc, char *argv[])
 {
     QCoreApplication a(argc, argv);
 
-    // used for application settings (QSettings)
     QCoreApplication::setOrganizationDomain("LinuxFoundation");
     QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
     QCoreApplication::setApplicationName("InputEventManager");
-    QCoreApplication::setApplicationVersion("0.3.0");
+    QCoreApplication::setApplicationVersion("0.7.0");
+
+    QCommandLineParser parser;
+    parser.setApplicationDescription("AGL InputEventManager - see wwww... for more details");
+    parser.addHelpOption();
+    parser.addVersionOption();
+    QCommandLineOption quietOption(QStringList() << "q" << "quiet",
+        QCoreApplication::translate("main", "Be quiet. No outputs."));
+    parser.addOption(quietOption);
+    parser.process(a);
+
+    if (parser.isSet(quietOption))
+    {
+        qInstallMessageHandler(noOutput);
+    }
 
     InputEventManager *inputEventManager = new InputEventManager();