aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/main.cpp
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-08-25 14:14:38 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2021-08-26 15:43:32 +0200
commit655c8ec05fb9057725ccc1c8512989e1a8fd25b1 (patch)
treebdaaeee0db4bb011c89af96bfb92cd7e2802a9c7 /tools/qmllint/main.cpp
parent3dccc843363b26f6e51c9a78be347dd905904e25 (diff)
qmllint: Put warning options at the top
This puts them right below the description of warning levels and hopefully makes the whole help easier to read. Task-number: QTBUG-95971 Change-Id: Iff6062e700c2c277fc4c69a8130ba6b2dd5e35c0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tools/qmllint/main.cpp')
-rw-r--r--tools/qmllint/main.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp
index 3c9d19eb58..4026f40334 100644
--- a/tools/qmllint/main.cpp
+++ b/tools/qmllint/main.cpp
@@ -240,6 +240,18 @@ All warnings can be set to three levels:
info - Displays the warning but does not influence the return code.
warning - Displays the warning and leads to a non-zero exit code if encountered.
)"));
+
+ for (auto it = options.cbegin(); it != options.cend(); ++it) {
+ QCommandLineOption option(
+ it.key(),
+ it.value().m_description
+ + QStringLiteral(" (default: %1)").arg(it.value().levelToString()),
+ QStringLiteral("level"), it.value().levelToString());
+ parser.addOption(option);
+ settings.addOption(QStringLiteral("Warnings/") + it.value().m_settingsName,
+ it.value().levelToString());
+ }
+
parser.addHelpOption();
parser.addVersionOption();
@@ -262,17 +274,6 @@ All warnings can be set to three levels:
"command line options into consideration"));
parser.addOption(ignoreSettings);
- for (auto it = options.cbegin(); it != options.cend(); ++it) {
- QCommandLineOption option(
- it.key(),
- it.value().m_description
- + QStringLiteral(" (default: %1)").arg(it.value().levelToString()),
- QStringLiteral("level"), it.value().levelToString());
- parser.addOption(option);
- settings.addOption(QStringLiteral("Warnings/") + it.value().m_settingsName,
- it.value().levelToString());
- }
-
QCommandLineOption resourceOption(
{ QStringLiteral("resource") },
QStringLiteral("Look for related files in the given resource file"),