| 325 | } |
| 326 | |
| 327 | static bool ParseOptions(const CommandLineOptionDefinition* options, CommandLineArgEnumerator* argEnumerator) |
| 328 | { |
| 329 | bool firstOption = true; |
| 330 | |
| 331 | const char* argument; |
| 332 | while (argEnumerator->TryPopString(&argument)) |
| 333 | { |
| 334 | if (HandleSpecialArgument(argument)) |
| 335 | { |
| 336 | continue; |
| 337 | } |
| 338 | |
| 339 | if (argument[0] == '-') |
| 340 | { |
| 341 | if (argument[1] == '-') |
| 342 | { |
| 343 | if (!ParseLongOption(options, argEnumerator, &argument[2])) |
| 344 | { |
| 345 | return false; |
| 346 | } |
| 347 | } |
| 348 | else |
| 349 | { |
| 350 | if (!ParseShortOption(options, argEnumerator, argument)) |
| 351 | { |
| 352 | return false; |
| 353 | } |
| 354 | } |
| 355 | firstOption = false; |
| 356 | } |
| 357 | else if (!firstOption) |
| 358 | { |
| 359 | Console::Error::WriteLine("All options must be passed at the end of the command line."); |
| 360 | return false; |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | return true; |
| 365 | } |
| 366 | |
| 367 | static bool ParseLongOption( |
| 368 | const CommandLineOptionDefinition* options, CommandLineArgEnumerator* argEnumerator, const char* argument) |
no test coverage detected