| 301 | } |
| 302 | |
| 303 | static bool checkSingleParameterArgumentPreconditions( |
| 304 | std::string const& argument, ParsedArguments const& parsedArguments, |
| 305 | std::string& errorMsg) |
| 306 | { |
| 307 | auto foundArgument = parsedArguments.find(argument); |
| 308 | if (foundArgument != parsedArguments.end()) { |
| 309 | std::vector<std::string> const& optionArguments = foundArgument->second; |
| 310 | |
| 311 | if (optionArguments.empty()) { |
| 312 | errorMsg = argument + " argument given without an argument."; |
| 313 | return false; |
| 314 | } |
| 315 | if (optionArguments.size() > 1) { |
| 316 | errorMsg = "too many arguments passed to " + argument + "."; |
| 317 | return false; |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | return true; |
| 322 | } |
no test coverage detected
searching dependent graphs…