grep: makw -w support unconditional

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-04-26 08:45:44 +02:00
parent 5f94346f73
commit 05273daf6f
2 changed files with 4 additions and 8 deletions

View File

@ -24,10 +24,9 @@
/* options */
#define OPTSTR_GREP \
"lnqvscFiHhe:f:Lorm:" \
"lnqvscFiHhe:f:Lorm:w" \
IF_FEATURE_GREP_CONTEXT("A:B:C:") \
IF_FEATURE_GREP_EGREP_ALIAS("E") \
IF_DESKTOP("w") \
IF_EXTRA_COMPAT("z") \
"aI"
@ -51,11 +50,11 @@ enum {
OPTBIT_o, /* show only matching parts of lines */
OPTBIT_r, /* recurse dirs */
OPTBIT_m, /* -m MAX_MATCHES */
OPTBIT_w, /* -w whole word match */
IF_FEATURE_GREP_CONTEXT( OPTBIT_A ,) /* -A NUM: after-match context */
IF_FEATURE_GREP_CONTEXT( OPTBIT_B ,) /* -B NUM: before-match context */
IF_FEATURE_GREP_CONTEXT( OPTBIT_C ,) /* -C NUM: -A and -B combined */
IF_FEATURE_GREP_EGREP_ALIAS(OPTBIT_E ,) /* extended regexp */
IF_DESKTOP( OPTBIT_w ,) /* whole word match */
IF_EXTRA_COMPAT( OPTBIT_z ,) /* input is NUL terminated */
OPT_l = 1 << OPTBIT_l,
OPT_n = 1 << OPTBIT_n,
@ -73,11 +72,11 @@ enum {
OPT_o = 1 << OPTBIT_o,
OPT_r = 1 << OPTBIT_r,
OPT_m = 1 << OPTBIT_m,
OPT_w = 1 << OPTBIT_w,
OPT_A = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_A)) + 0,
OPT_B = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_B)) + 0,
OPT_C = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_C)) + 0,
OPT_E = IF_FEATURE_GREP_EGREP_ALIAS((1 << OPTBIT_E)) + 0,
OPT_w = IF_DESKTOP( (1 << OPTBIT_w)) + 0,
OPT_z = IF_EXTRA_COMPAT( (1 << OPTBIT_z)) + 0,
};

View File

@ -1531,8 +1531,7 @@
"\n -H HOST Log HOST into the utmp file as the hostname" \
#define grep_trivial_usage \
"[-HhnlLoqvsri" \
IF_DESKTOP("w") \
"[-HhnlLoqvsriw" \
"F" \
IF_FEATURE_GREP_EGREP_ALIAS("E") \
IF_EXTRA_COMPAT("z") \
@ -1554,9 +1553,7 @@
"\n -s Suppress open and read errors" \
"\n -r Recurse" \
"\n -i Ignore case" \
IF_DESKTOP( \
"\n -w Match whole words only" \
) \
"\n -F PATTERN is a literal (not regexp)" \
IF_FEATURE_GREP_EGREP_ALIAS( \
"\n -E PATTERN is an extended regexp" \