From 479ee4fa461e3c9bd71480d8e7a0bcabced52919 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 30 Mar 2016 18:20:40 +0200 Subject: moc: bail out early on missing or invalid options file If moc is invoked with the @ argument and no options file is specified or the options file cannot be read, do not try to parse the empty arguments list. Otherwise QCommandLineParser will print an additional error message that is of no value for the user. Task-number: QTBUG-51847 Change-Id: I9aa1eb20a44097b553123be8bc6fded87473a03a Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/tools/moc/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools') diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp index a5cbad7668..18fbc977ab 100644 --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -282,6 +282,8 @@ int runMoc(int argc, char **argv) QStringLiteral("Read additional options from option-file.")); const QStringList arguments = argumentsFromCommandLineAndFile(app.arguments()); + if (arguments.isEmpty()) + return 1; parser.process(arguments); -- cgit v1.2.3