aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-04-26 08:45:44 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-26 08:45:44 +0200
commit05273daf6ff570e5e4936028ef501c59be745311 (patch)
tree606b712779247ea91027f3057b77bd6baa7d96bc
parent5f94346f7387cb5e33cf202dd3306f062bb22052 (diff)
downloadbusybox-w32-05273daf6ff570e5e4936028ef501c59be745311.tar.gz
busybox-w32-05273daf6ff570e5e4936028ef501c59be745311.tar.bz2
busybox-w32-05273daf6ff570e5e4936028ef501c59be745311.zip
grep: makw -w support unconditional
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--findutils/grep.c7
-rw-r--r--include/usage.h5
2 files changed, 4 insertions, 8 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index a321cc31b..40caef423 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -24,10 +24,9 @@
24 24
25/* options */ 25/* options */
26#define OPTSTR_GREP \ 26#define OPTSTR_GREP \
27 "lnqvscFiHhe:f:Lorm:" \ 27 "lnqvscFiHhe:f:Lorm:w" \
28 IF_FEATURE_GREP_CONTEXT("A:B:C:") \ 28 IF_FEATURE_GREP_CONTEXT("A:B:C:") \
29 IF_FEATURE_GREP_EGREP_ALIAS("E") \ 29 IF_FEATURE_GREP_EGREP_ALIAS("E") \
30 IF_DESKTOP("w") \
31 IF_EXTRA_COMPAT("z") \ 30 IF_EXTRA_COMPAT("z") \
32 "aI" 31 "aI"
33 32
@@ -51,11 +50,11 @@ enum {
51 OPTBIT_o, /* show only matching parts of lines */ 50 OPTBIT_o, /* show only matching parts of lines */
52 OPTBIT_r, /* recurse dirs */ 51 OPTBIT_r, /* recurse dirs */
53 OPTBIT_m, /* -m MAX_MATCHES */ 52 OPTBIT_m, /* -m MAX_MATCHES */
53 OPTBIT_w, /* -w whole word match */
54 IF_FEATURE_GREP_CONTEXT( OPTBIT_A ,) /* -A NUM: after-match context */ 54 IF_FEATURE_GREP_CONTEXT( OPTBIT_A ,) /* -A NUM: after-match context */
55 IF_FEATURE_GREP_CONTEXT( OPTBIT_B ,) /* -B NUM: before-match context */ 55 IF_FEATURE_GREP_CONTEXT( OPTBIT_B ,) /* -B NUM: before-match context */
56 IF_FEATURE_GREP_CONTEXT( OPTBIT_C ,) /* -C NUM: -A and -B combined */ 56 IF_FEATURE_GREP_CONTEXT( OPTBIT_C ,) /* -C NUM: -A and -B combined */
57 IF_FEATURE_GREP_EGREP_ALIAS(OPTBIT_E ,) /* extended regexp */ 57 IF_FEATURE_GREP_EGREP_ALIAS(OPTBIT_E ,) /* extended regexp */
58 IF_DESKTOP( OPTBIT_w ,) /* whole word match */
59 IF_EXTRA_COMPAT( OPTBIT_z ,) /* input is NUL terminated */ 58 IF_EXTRA_COMPAT( OPTBIT_z ,) /* input is NUL terminated */
60 OPT_l = 1 << OPTBIT_l, 59 OPT_l = 1 << OPTBIT_l,
61 OPT_n = 1 << OPTBIT_n, 60 OPT_n = 1 << OPTBIT_n,
@@ -73,11 +72,11 @@ enum {
73 OPT_o = 1 << OPTBIT_o, 72 OPT_o = 1 << OPTBIT_o,
74 OPT_r = 1 << OPTBIT_r, 73 OPT_r = 1 << OPTBIT_r,
75 OPT_m = 1 << OPTBIT_m, 74 OPT_m = 1 << OPTBIT_m,
75 OPT_w = 1 << OPTBIT_w,
76 OPT_A = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_A)) + 0, 76 OPT_A = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_A)) + 0,
77 OPT_B = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_B)) + 0, 77 OPT_B = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_B)) + 0,
78 OPT_C = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_C)) + 0, 78 OPT_C = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_C)) + 0,
79 OPT_E = IF_FEATURE_GREP_EGREP_ALIAS((1 << OPTBIT_E)) + 0, 79 OPT_E = IF_FEATURE_GREP_EGREP_ALIAS((1 << OPTBIT_E)) + 0,
80 OPT_w = IF_DESKTOP( (1 << OPTBIT_w)) + 0,
81 OPT_z = IF_EXTRA_COMPAT( (1 << OPTBIT_z)) + 0, 80 OPT_z = IF_EXTRA_COMPAT( (1 << OPTBIT_z)) + 0,
82}; 81};
83 82
diff --git a/include/usage.h b/include/usage.h
index 4568fac9f..38594811e 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1531,8 +1531,7 @@
1531 "\n -H HOST Log HOST into the utmp file as the hostname" \ 1531 "\n -H HOST Log HOST into the utmp file as the hostname" \
1532 1532
1533#define grep_trivial_usage \ 1533#define grep_trivial_usage \
1534 "[-HhnlLoqvsri" \ 1534 "[-HhnlLoqvsriw" \
1535 IF_DESKTOP("w") \
1536 "F" \ 1535 "F" \
1537 IF_FEATURE_GREP_EGREP_ALIAS("E") \ 1536 IF_FEATURE_GREP_EGREP_ALIAS("E") \
1538 IF_EXTRA_COMPAT("z") \ 1537 IF_EXTRA_COMPAT("z") \
@@ -1554,9 +1553,7 @@
1554 "\n -s Suppress open and read errors" \ 1553 "\n -s Suppress open and read errors" \
1555 "\n -r Recurse" \ 1554 "\n -r Recurse" \
1556 "\n -i Ignore case" \ 1555 "\n -i Ignore case" \
1557 IF_DESKTOP( \
1558 "\n -w Match whole words only" \ 1556 "\n -w Match whole words only" \
1559 ) \
1560 "\n -F PATTERN is a literal (not regexp)" \ 1557 "\n -F PATTERN is a literal (not regexp)" \
1561 IF_FEATURE_GREP_EGREP_ALIAS( \ 1558 IF_FEATURE_GREP_EGREP_ALIAS( \
1562 "\n -E PATTERN is an extended regexp" \ 1559 "\n -E PATTERN is an extended regexp" \