| 445 | } |
| 446 | |
| 447 | int locate_option(int argc, char **argv, const OptionDef *options, |
| 448 | const char *optname) |
| 449 | { |
| 450 | const OptionDef *po; |
| 451 | int i; |
| 452 | |
| 453 | for (i = 1; i < argc; i++) { |
| 454 | const char *cur_opt = argv[i]; |
| 455 | |
| 456 | if (*cur_opt++ != '-') |
| 457 | continue; |
| 458 | |
| 459 | po = find_option(options, cur_opt); |
| 460 | if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o') |
| 461 | po = find_option(options, cur_opt + 2); |
| 462 | |
| 463 | if ((!po->name && !strcmp(cur_opt, optname)) || |
| 464 | (po->name && !strcmp(optname, po->name))) |
| 465 | return i; |
| 466 | |
| 467 | if (!po->name || po->flags & HAS_ARG) |
| 468 | i++; |
| 469 | } |
| 470 | return 0; |
| 471 | } |
| 472 | |
| 473 | static void dump_argument(const char *a) |
| 474 | { |
no test coverage detected