redai/main.cpp

30 lines
680 B
C++
Raw Normal View History

2023-03-27 12:49:53 -04:00
#include <QApplication>
#include <QCommandLineParser>
#include "MainWindow.h"
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QCommandLineParser parser;
2023-06-15 15:19:34 -04:00
parser.addPositionalArgument("site-path", QCoreApplication::translate("main", "Site directory."));
2023-03-27 12:49:53 -04:00
parser.process(app);
auto args = parser.positionalArguments();
2023-06-15 15:19:34 -04:00
if (args.size() < 1) {
2023-03-27 12:49:53 -04:00
return -1;
}
2023-06-15 15:19:34 -04:00
QString sitePath = args[0];
QString defPath = QString("%1/art").arg(sitePath);
QString assetPath = QString("%1/assets/art").arg(sitePath);
QString dataPath = QString("%1/data").arg(sitePath);
MainWindow window(defPath, assetPath, dataPath);
2023-03-27 12:49:53 -04:00
window.show();
return QApplication::exec();
}