aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-10-30 12:37:49 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-11-07 15:28:54 +0000
commitac7ea0553fc50ea53e827cb326c6929e1c10a01d (patch)
tree81cc290a1f5ccfb1eb27efdd62d6f23fd47c5bba /src/app
parent659df2d72645548ffe70b54a22ebe09d12402806 (diff)
CLI: Make the --help option behave exactly like the help command
For consistency, the option can also take an argument now. Change-Id: Iba585ef7ee007efe25d1ddc52f2375d164e51b9b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/qbs/parser/commandlineparser.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp
index 061a6f057..bb33d41ec 100644
--- a/src/app/qbs/parser/commandlineparser.cpp
+++ b/src/app/qbs/parser/commandlineparser.cpp
@@ -325,12 +325,10 @@ void CommandLineParser::CommandLineParserPrivate::doParse()
if (command) {
commandLine.removeFirst();
} else { // No command given.
- // As an exception to the command-based syntax, we allow -h or --help as the
- // sole contents of the command line, because people are used to this working.
- if (commandLine.count() == 1 && (commandLine.first() == QLatin1String("-h")
- || commandLine.first() == QLatin1String("--help"))) {
+ if (commandLine.first() == QLatin1String("-h")
+ || commandLine.first() == QLatin1String("--help")) {
command = commandPool.getCommand(HelpCommandType);
- commandLine.clear();
+ commandLine.takeFirst();
} else {
command = commandPool.getCommand(BuildCommandType);
}