File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,6 +268,10 @@ inline std::string RequiresArgumentErr(const std::string& arg) {
268268 return arg + " requires an argument" ;
269269}
270270
271+ inline std::string UnexpectedArgumentErr (const std::string& arg) {
272+ return arg + " does not take an argument" ;
273+ }
274+
271275inline std::string NegationImpliesBooleanError (const std::string& arg) {
272276 return arg + " is an invalid negation because it is not a boolean option" ;
273277}
@@ -475,6 +479,10 @@ void OptionsParser<Options>::Parse(
475479 value = value.substr (1 ); // Treat \- as escaping an -.
476480 }
477481 }
482+ } else if (info.type == kBoolean && equals_index != std::string::npos) {
483+ // Boolean options don't accept arguments
484+ errors->push_back (UnexpectedArgumentErr (name));
485+ break ;
478486 }
479487
480488 switch (info.type ) {
You can’t perform that action at this time.
0 commit comments