diff options
Diffstat (limited to 'findutils/grep.c')
-rw-r--r-- | findutils/grep.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/findutils/grep.c b/findutils/grep.c index 568ab12c2..7c5f73d2f 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -107,6 +107,7 @@ | |||
107 | //usage:#define fgrep_trivial_usage NOUSAGE_STR | 107 | //usage:#define fgrep_trivial_usage NOUSAGE_STR |
108 | //usage:#define fgrep_full_usage "" | 108 | //usage:#define fgrep_full_usage "" |
109 | 109 | ||
110 | /* -e,-f are lists; -m,-A,-B,-C have numeric param */ | ||
110 | #define OPTSTR_GREP \ | 111 | #define OPTSTR_GREP \ |
111 | "lnqvscFiHhe:*f:*Lorm:+wx" \ | 112 | "lnqvscFiHhe:*f:*Lorm:+wx" \ |
112 | IF_FEATURE_GREP_CONTEXT("A:+B:+C:+") \ | 113 | IF_FEATURE_GREP_CONTEXT("A:+B:+C:+") \ |
@@ -686,11 +687,9 @@ int grep_main(int argc UNUSED_PARAM, char **argv) | |||
686 | 687 | ||
687 | /* do normal option parsing */ | 688 | /* do normal option parsing */ |
688 | #if ENABLE_FEATURE_GREP_CONTEXT | 689 | #if ENABLE_FEATURE_GREP_CONTEXT |
689 | /* -H unsets -h; -C unsets -A,-B; -e,-f are lists; | 690 | /* -H unsets -h; -C unsets -A,-B */ |
690 | * -m,-A,-B,-C have numeric param */ | ||
691 | opt_complementary = "H-h:C-AB"; | ||
692 | opts = getopt32(argv, | 691 | opts = getopt32(argv, |
693 | OPTSTR_GREP, | 692 | "^" OPTSTR_GREP "\0" "H-h:C-AB", |
694 | &pattern_head, &fopt, &max_matches, | 693 | &pattern_head, &fopt, &max_matches, |
695 | &lines_after, &lines_before, &Copt); | 694 | &lines_after, &lines_before, &Copt); |
696 | 695 | ||
@@ -716,9 +715,7 @@ int grep_main(int argc UNUSED_PARAM, char **argv) | |||
716 | } | 715 | } |
717 | #else | 716 | #else |
718 | /* with auto sanity checks */ | 717 | /* with auto sanity checks */ |
719 | /* -H unsets -h; -c,-q or -l unset -n; -e,-f are lists; -m N */ | 718 | getopt32(argv, "^" OPTSTR_GREP "\0" "H-h:c-n:q-n:l-n:", // why trailing ":"? |
720 | opt_complementary = "H-h:c-n:q-n:l-n:"; | ||
721 | getopt32(argv, OPTSTR_GREP, | ||
722 | &pattern_head, &fopt, &max_matches); | 719 | &pattern_head, &fopt, &max_matches); |
723 | #endif | 720 | #endif |
724 | invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */ | 721 | invert_search = ((option_mask32 & OPT_v) != 0); /* 0 | 1 */ |