From ba68c325688acf3072715757480497524f61c425 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 23 Feb 2017 17:13:43 +0100 Subject: Do not crash when qmlcachegen is called without arguments Change-Id: Ib91271e0ac365f69e43dfc0981c74dcfd69d6ab3 Reviewed-by: Simon Hausmann --- tools/qmlcachegen/qmlcachegen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3