// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
#include "MainWindow.h"
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QCommandLineParser parser;
parser.addPositionalArgument("site-path", QCoreApplication::translate("main", "Site directory."));
parser.process(app);
auto args = parser.positionalArguments();
if (args.empty()) {
return -1;
}
const QDir sitePath = args[0];
const QString defPath = sitePath.absoluteFilePath("art");
const QDir assetPath = sitePath.absoluteFilePath("assets");
const QString artAssetPath = assetPath.absoluteFilePath("art");
const QString dataPath = sitePath.absoluteFilePath("data");
MainWindow window(defPath, artAssetPath, dataPath);
window.show();
return QApplication::exec();