aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2017-02-23 17:13:43 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-02-23 18:23:47 +0000
commitba68c325688acf3072715757480497524f61c425 (patch)
tree504f077f0f571ff05ba1ef19dc47e6c358297d95 /tools
parentb17337da34a76f9512a826b19dcd45b337295c3b (diff)
Do not crash when qmlcachegen is called without arguments
Change-Id: Ib91271e0ac365f69e43dfc0981c74dcfd69d6ab3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index 10d9829520..977c5b6ff1 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -276,7 +276,9 @@ int main(int argc, char **argv)
parser.process(app);
const QStringList sources = parser.positionalArguments();
- if (sources.count() > 1) {
+ if (sources.isEmpty()){
+ parser.showHelp();
+ } else if (sources.count() > 1) {
fprintf(stderr, "%s\n", qPrintable(QStringLiteral("Too many input files specified: '") + sources.join(QStringLiteral("' '")) + QLatin1Char('\'')));
return EXIT_FAILURE;
}