aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qt.io>2017-01-23 17:01:22 +0900
committerTasuku Suzuki <tasuku.suzuki@qt.io>2017-01-25 04:52:58 +0000
commit9aed949bb99b9bf328322457a02ad1a9fb330f2d (patch)
treea03c25b9dd16ff3c1910875d06d3a36b7e27d203 /tools/qmllint
parentf74b7b15979364d61a48e36315442c501bb9ea1a (diff)
Fix build without features.commandlineparser
Change-Id: I3a23e53fc647f5257593e0aece7198eea430cf14 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/qmllint')
-rw-r--r--tools/qmllint/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp
index 211427cc64..45914353a8 100644
--- a/tools/qmllint/main.cpp
+++ b/tools/qmllint/main.cpp
@@ -29,7 +29,9 @@
#include <QDebug>
#include <QFile>
#include <QFileInfo>
+#if QT_CONFIG(commandlineparser)
#include <QCommandLineParser>
+#endif
#include <QCoreApplication>
#include <private/qv4value_p.h>
@@ -72,6 +74,7 @@ int main(int argv, char *argc[])
QCoreApplication app(argv, argc);
QCoreApplication::setApplicationName("qmllint");
QCoreApplication::setApplicationVersion("1.0");
+#if QT_CONFIG(commandlineparser)
QCommandLineParser parser;
parser.setApplicationDescription(QLatin1String("QML syntax verifier"));
parser.addHelpOption();
@@ -87,8 +90,15 @@ int main(int argv, char *argc[])
}
bool silent = parser.isSet(silentOption);
+#else
+ bool silent = false;
+#endif
bool success = true;
+#if QT_CONFIG(commandlineparser)
foreach (const QString &filename, parser.positionalArguments()) {
+#else
+ foreach (const QString &filename, app.arguments()) {
+#endif
success &= lint_file(filename, silent);
}