diff --git a/src/akashimain.cpp b/src/akashimain.cpp index fd7202c..4782a18 100644 --- a/src/akashimain.cpp +++ b/src/akashimain.cpp @@ -1,11 +1,14 @@ -#include "akashimain.h" +#include "include/akashimain.h" #include "ui_akashimain.h" +#include + AkashiMain::AkashiMain(QWidget *parent) : QMainWindow(parent) , ui(new Ui::AkashiMain) { ui->setupUi(this); + qDebug("Main application started"); } AkashiMain::~AkashiMain() diff --git a/src/main.cpp b/src/main.cpp index 55b8a9f..a078275 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,11 +1,30 @@ -#include "akashimain.h" +#include "include/akashimain.h" #include +#include +#include +#include int main(int argc, char *argv[]) { - QApplication a(argc, argv); + QApplication app(argc, argv); + QApplication::setApplicationName("akashi"); + QApplication::setApplicationVersion("0.0.1"); + + QCommandLineParser parser; + parser.setApplicationDescription("A server for Attorney Online 2"); + parser.addHelpOption(); + parser.addVersionOption(); + + QCommandLineOption headlessOption(QStringList() << "l" << "headless", "Run the server without a GUI"); + parser.addOption(headlessOption); + + parser.process(app); + bool headless = parser.isSet(headlessOption); + AkashiMain w; - w.show(); - return a.exec(); + if(!headless) + w.show(); + + return app.exec(); }