| 487 | } |
| 488 | |
| 489 | int locate_option(int argc, char **argv, const OptionDef *options, |
| 490 | const char *optname) |
| 491 | { |
| 492 | const OptionDef *po; |
| 493 | int i; |
| 494 | |
| 495 | for (i = 1; i < argc; i++) { |
| 496 | const char *cur_opt = argv[i]; |
| 497 | |
| 498 | if (!(cur_opt[0] == '-' && cur_opt[1])) |
| 499 | continue; |
| 500 | cur_opt++; |
| 501 | |
| 502 | po = find_option(options, cur_opt); |
| 503 | if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o') |
| 504 | po = find_option(options, cur_opt + 2); |
| 505 | |
| 506 | if ((!po->name && !strcmp(cur_opt, optname)) || |
| 507 | (po->name && !strcmp(optname, po->name))) |
| 508 | return i; |
| 509 | |
| 510 | if (!po->name || opt_has_arg(po)) |
| 511 | i++; |
| 512 | } |
| 513 | return 0; |
| 514 | } |
| 515 | |
| 516 | static void dump_argument(FILE *report_file, const char *a) |
| 517 | { |
no test coverage detected