Skip to content

Commit 404af80

Browse files
committed
Read verbose option first.
1 parent 2970a4c commit 404af80

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/main.cpp

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ int main(int argc, char **argv)
134134

135135
Deploy deploy;
136136

137+
if (cliParser.isSet(verboseOpt)) {
138+
bool ok = false;
139+
int number = cliParser.value(verboseOpt).toInt(&ok);
140+
141+
if (ok)
142+
deploy.logLevel = number;
143+
144+
deploy.LogDebug() << "Argument found:" << verboseOpt.names().first();
145+
146+
if (!ok)
147+
deploy.LogError() << "Could not parse verbose level";
148+
}
149+
137150
QString desktopFile;
138151
QString desktopExecEntry;
139152
QString desktopIconEntry;
@@ -373,43 +386,32 @@ int main(int argc, char **argv)
373386

374387
// Set options from command line
375388
if (cliParser.isSet(noPluginsOpt)) {
376-
deploy.LogDebug() << "Argument found:" << noPluginsOpt.valueName();
389+
deploy.LogDebug() << "Argument found:" << noPluginsOpt.names().first();
377390
plugins = false;
378391
}
379392

380393
bool appimage = false;
381394

382395
if (cliParser.isSet(appimageOpt)) {
383-
deploy.LogDebug() << "Argument found:" << appimageOpt.valueName();
396+
deploy.LogDebug() << "Argument found:" << appimageOpt.names().first();
384397
appimage = true;
385398
deploy.bundleAllButCoreLibs = true;
386399
}
387400

388401
if (cliParser.isSet(noStripOpt)) {
389-
deploy.LogDebug() << "Argument found:" << noStripOpt.valueName();
402+
deploy.LogDebug() << "Argument found:" << noStripOpt.names().first();
390403
deploy.runStripEnabled = false;
391404
}
392405

393406
if (cliParser.isSet(bundleNonQtLibsOpt)) {
394-
deploy.LogDebug() << "Argument found:" << bundleNonQtLibsOpt.valueName();
407+
deploy.LogDebug() << "Argument found:" << bundleNonQtLibsOpt.names().first();
395408
deploy.bundleAllButCoreLibs = true;
396409
}
397410

398-
if (cliParser.isSet(verboseOpt)) {
399-
deploy.LogDebug() << "Argument found:" << verboseOpt.valueName();
400-
bool ok = false;
401-
int number = cliParser.value(verboseOpt).toInt(&ok);
402-
403-
if (ok)
404-
deploy.logLevel = number;
405-
else
406-
deploy.LogError() << "Could not parse verbose level";
407-
}
408-
409411
QStringList additionalExecutables;
410412

411413
if (cliParser.isSet(executableOpt)) {
412-
deploy.LogDebug() << "Argument found:" << executableOpt.valueName();
414+
deploy.LogDebug() << "Argument found:" << executableOpt.names().first();
413415
QString executables = cliParser.value(executableOpt).trimmed();
414416

415417
if (!executables.isEmpty())
@@ -422,7 +424,7 @@ int main(int argc, char **argv)
422424
bool qmldirArgumentUsed = false;
423425

424426
if (cliParser.isSet(qmldirOpt)) {
425-
deploy.LogDebug() << "Argument found:" << qmldirOpt.valueName();
427+
deploy.LogDebug() << "Argument found:" << qmldirOpt.names().first();
426428
QString dirs = cliParser.value(qmldirOpt).trimmed();
427429
qmldirArgumentUsed = true;
428430

@@ -433,14 +435,14 @@ int main(int argc, char **argv)
433435
}
434436

435437
if (cliParser.isSet(alwaysOverwriteOpt)) {
436-
deploy.LogDebug() << "Argument found:" << alwaysOverwriteOpt.valueName();
438+
deploy.LogDebug() << "Argument found:" << alwaysOverwriteOpt.names().first();
437439
deploy.alwaysOwerwriteEnabled = true;
438440
}
439441

440442
bool skipTranslations = false;
441443

442444
if (cliParser.isSet(noTranslationsOpt)) {
443-
deploy.LogDebug() << "Argument found:" << noTranslationsOpt.valueName();
445+
deploy.LogDebug() << "Argument found:" << noTranslationsOpt.names().first();
444446
skipTranslations = true;
445447
}
446448

0 commit comments

Comments
 (0)