Add comand line argument parser
authorChristoph Egger <siccegge@cs.fau.de>
Wed, 21 May 2014 13:14:58 +0000 (15:14 +0200)
committerChristoph Egger <siccegge@cs.fau.de>
Wed, 21 May 2014 13:14:58 +0000 (15:14 +0200)
src/main.cxx

index e5c51287bc605b5d911a81899cf13528a3ad909e..14dc0cb2d82bdd2a9820cfdeaf6ba71cb8a03f78 100644 (file)
@@ -4,6 +4,7 @@
 #include <climits>
 
 #include <QApplication>
+#include <QCommandLineParser>
 #include <QTextEdit>
 
 #include "log4cxx/logger.h"
@@ -20,6 +21,7 @@ int main(int argc, char** argv)
 {
     log4cxx::BasicConfigurator::configure();
     log4cxx::LoggerPtr _logger(log4cxx::Logger::getLogger("main"));
+
     LOG4CXX_DEBUG(_logger, "Initializing LLVM");
     llvm::InitializeAllTargetInfos();
     llvm::InitializeAllTargetMCs();
@@ -28,6 +30,11 @@ int main(int argc, char** argv)
 
     LOG4CXX_DEBUG(_logger, "Initializing Qt");
     QApplication app(argc, argv);
+       QCommandLineParser parser;
+
+       QApplication::setApplicationName("frida");
+       parser.addHelpOption();
+       parser.process(app);
 
     Mainwindow m;
     m.show();