int main(int argc, char** argv)
{
+ QApplication app(argc, argv);
+
log4cxx::BasicConfigurator::configure();
log4cxx::LoggerPtr _logger(log4cxx::Logger::getLogger("main"));
parser.addVersionOption();
parser.addPositionalArgument("filename", QCoreApplication::translate("main", "File to disassemble."));
- QApplication app(argc, argv);
+
parser.process(app);
LOG4CXX_DEBUG(_logger, "Initializing LLVM");
LOG4CXX_DEBUG(_logger, "Initializing Qt");
- Mainwindow m(parser.positionalArguments().at(0).toStdString());
- m.show();
+ std::string filename;
+ if (parser.positionalArguments().isEmpty()) {
+ filename = "";
+ } else {
+ filename = parser.positionalArguments().at(0).toStdString();
+ }
- return app.exec();
+ Mainwindow m(filename);
+ m.show();
+ return app.exec();
}