grep: makw -w support unconditional
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 26 Apr 2010 06:45:44 +0000 (08:45 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 26 Apr 2010 06:45:44 +0000 (08:45 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
findutils/grep.c
include/usage.h

index a321cc3..40caef4 100644 (file)
 
 /* 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,
 };
 
index 4568fac..3859481 100644 (file)
      "\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") \
      "\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" \