summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'facetracknoir/main.cpp')
-rw-r--r--facetracknoir/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp
index ae237b61..bbdfbc70 100644
--- a/facetracknoir/main.cpp
+++ b/facetracknoir/main.cpp
@@ -1,5 +1,6 @@
#include "ui.h"
#include <QApplication>
+#include <QCommandLineParser>
#include <QStyleFactory>
#include <QStringList>
#include <memory>
@@ -28,8 +29,21 @@ int main(int argc, char** argv)
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
QApplication app(argc, argv);
+ QCommandLineParser p;
+ p.setApplicationDescription("opentrack - Head tracking software for MS Windows, Linux, and Apple OSX");
+ p.addHelpOption();
+ QCommandLineOption autostartOption(QStringList() << "a" << "autostart", "Load <profile> and start tracking", "profile");
+ p.addOption(autostartOption);
+ p.process(app);
+
MainWindow w;
+ QString profile = p.value(autostartOption);
+ if (! profile.isEmpty() )
+ {
+ w.open_and_run(profile);
+ }
+
w.show();
app.exec();