15 #include <QCommandLineParser>
41 QCommandLineParser parser;
42 parser.addHelpOption();
43 parser.addVersionOption();
45 bool ok = parser.addOptions(
49 _(
"Set debug log level (fatal/critical/warning/info/debug)."),
51 QStringLiteral(
"info")},
53 _(
"Automatically install modpack from a given URL."),
57 _(
"Load modpack list from given URL."),
61 _(
"Install modpacks to given directory hierarchy."),
65 qFatal(
"Adding command line arguments failed.");
73 if (!
log_init(parser.value(QStringLiteral(
"debug")))) {
76 if (parser.isSet(QStringLiteral(
"List"))) {
78 QUrl::fromUserInput(parser.value(QStringLiteral(
"List")));
80 if (parser.isSet(QStringLiteral(
"prefix"))) {
83 if (parser.isSet(QStringLiteral(
"install"))) {
91 qCritical(
"Cannot determine Freeciv21 storage directory.");
bool log_init(const QString &level_str, const QStringList &extra_rules)
Parses a log level string as provided by the user on the command line, and installs the corresponding...
void fcmp_parse_cmdline(const QCoreApplication &app)
Parse commandline parameters.
QString freeciv_storage_dir()
Returns string which gives freeciv storage dir.