| 620 | } |
| 621 | |
| 622 | static void check_typos(const char *arg, const struct option *options) |
| 623 | { |
| 624 | if (strlen(arg) < 3) |
| 625 | return; |
| 626 | |
| 627 | if (starts_with(arg, "no-")) { |
| 628 | error(_("did you mean `--%s` (with two dashes)?"), arg); |
| 629 | exit(129); |
| 630 | } |
| 631 | |
| 632 | for (; options->type != OPTION_END; options++) { |
| 633 | if (!options->long_name) |
| 634 | continue; |
| 635 | if (starts_with(options->long_name, arg)) { |
| 636 | error(_("did you mean `--%s` (with two dashes)?"), arg); |
| 637 | exit(129); |
| 638 | } |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | static void parse_options_check(const struct option *opts) |
| 643 | { |
no test coverage detected