summaryrefslogtreecommitdiff
path: root/src/support/command-line.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/support/command-line.cpp')
-rw-r--r--src/support/command-line.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/support/command-line.cpp b/src/support/command-line.cpp
index 0e638173e..1b9f64295 100644
--- a/src/support/command-line.cpp
+++ b/src/support/command-line.cpp
@@ -136,11 +136,13 @@ void Options::parse(int argc, const char* argv[]) {
// Positional.
switch (positional) {
case Arguments::Zero:
+ // Optional arguments must use --flag=A format, and not separated by
+ // spaces (which would be ambiguous).
+ case Arguments::Optional:
std::cerr << "Unexpected positional argument '" << currentOption
<< "'\n";
exit(EXIT_FAILURE);
case Arguments::One:
- case Arguments::Optional:
if (positionalsSeen) {
std::cerr << "Unexpected second positional argument '"
<< currentOption << "' for " << positionalName << '\n';
@@ -198,11 +200,6 @@ void Options::parse(int argc, const char* argv[]) {
}
break;
case Arguments::Optional:
- if (!argument.size()) {
- if (i + 1 != e) {
- argument = argv[++i];
- }
- }
break;
}
option->action(this, argument);