| 495 | }; |
| 496 | |
| 497 | static void register_abbrev(struct parse_opt_ctx_t *p, |
| 498 | const struct option *option, enum opt_parsed flags, |
| 499 | struct parsed_option *abbrev, |
| 500 | struct parsed_option *ambiguous) |
| 501 | { |
| 502 | if (p->flags & PARSE_OPT_KEEP_UNKNOWN_OPT) |
| 503 | return; |
| 504 | if (abbrev->option && |
| 505 | !(abbrev->flags == flags && is_alias(p, abbrev->option, option))) { |
| 506 | /* |
| 507 | * If this is abbreviated, it is |
| 508 | * ambiguous. So when there is no |
| 509 | * exact match later, we need to |
| 510 | * error out. |
| 511 | */ |
| 512 | ambiguous->option = abbrev->option; |
| 513 | ambiguous->flags = abbrev->flags; |
| 514 | } |
| 515 | abbrev->option = option; |
| 516 | abbrev->flags = flags; |
| 517 | } |
| 518 | |
| 519 | static enum parse_opt_result parse_long_opt( |
| 520 | struct parse_opt_ctx_t *p, const char *arg, |
no test coverage detected