aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-02-25 02:38:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-02-25 02:38:54 +0000
commitf8ea0f3a66559a00c41fd7877bdc241973a60f8c (patch)
tree41778c9565c90e04f8d8a8c67caf8ae7b7eaf0d0
parent385304d449c25948315eb8872879d49bb2c65586 (diff)
downloadbusybox-w32-f8ea0f3a66559a00c41fd7877bdc241973a60f8c.tar.gz
busybox-w32-f8ea0f3a66559a00c41fd7877bdc241973a60f8c.tar.bz2
busybox-w32-f8ea0f3a66559a00c41fd7877bdc241973a60f8c.zip
grep: "implement" -a and -I by ignoring them
-rw-r--r--findutils/grep.c3
-rw-r--r--include/usage.h46
2 files changed, 27 insertions, 22 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 702a8a531..f6ea54ed2 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -28,6 +28,9 @@
28 USE_FEATURE_GREP_CONTEXT("A:B:C:") \ 28 USE_FEATURE_GREP_CONTEXT("A:B:C:") \
29 USE_FEATURE_GREP_EGREP_ALIAS("E") \ 29 USE_FEATURE_GREP_EGREP_ALIAS("E") \
30 USE_DESKTOP("w") \ 30 USE_DESKTOP("w") \
31 "aI"
32/* ignored: -a "assume all files to be text" */
33/* ignored: -I "assume binary files have no matches" */
31 34
32enum { 35enum {
33 OPTBIT_l, 36 OPTBIT_l,
diff --git a/include/usage.h b/include/usage.h
index f9d3de8c6..52f972038 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1073,36 +1073,38 @@
1073 " -H login_host Log login_host into the utmp file as the hostname" 1073 " -H login_host Log login_host into the utmp file as the hostname"
1074 1074
1075#define grep_trivial_usage \ 1075#define grep_trivial_usage \
1076 "[-rihHnqvso" \ 1076 "[-HhrilLnqvso" \
1077 USE_DESKTOP("w") \
1078 "eF" \
1077 USE_FEATURE_GREP_EGREP_ALIAS("E") \ 1079 USE_FEATURE_GREP_EGREP_ALIAS("E") \
1078 USE_FEATURE_GREP_CONTEXT("ABC") \ 1080 USE_FEATURE_GREP_CONTEXT("ABC") \
1079 "] PATTERN [FILEs...]" 1081 "] PATTERN [FILEs...]"
1080#define grep_full_usage \ 1082#define grep_full_usage \
1081 "Search for PATTERN in each FILE or standard input" \ 1083 "Search for PATTERN in each FILE or standard input" \
1082 "\n\nOptions:\n" \ 1084 "\n\nOptions:" \
1083 " -H Prefix output lines with filename where match was found\n" \ 1085 "\n -H Prefix output lines with filename where match was found" \
1084 " -h Suppress the prefixing filename on output\n" \ 1086 "\n -h Suppress the prefixing filename on output" \
1085 " -r Recurse subdirectories\n" \ 1087 "\n -r Recurse subdirectories" \
1086 " -i Ignore case distinctions\n" \ 1088 "\n -i Ignore case distinctions" \
1087 " -l List names of files that match\n" \ 1089 "\n -l List names of files that match" \
1088 " -L List names of files that do not match\n" \ 1090 "\n -L List names of files that do not match" \
1089 " -n Print line number with output lines\n" \ 1091 "\n -n Print line number with output lines" \
1090 " -q Be quiet. Returns 0 if PATTERN was found, 1 otherwise\n" \ 1092 "\n -q Be quiet. Returns 0 if PATTERN was found, 1 otherwise" \
1091 " -v Select non-matching lines\n" \ 1093 "\n -v Select non-matching lines" \
1092 " -s Suppress file open/read error messages\n" \ 1094 "\n -s Suppress file open/read error messages" \
1093 " -c Only print count of matching lines\n" \ 1095 "\n -c Only print count of matching lines" \
1094 " -f Read PATTERN from file\n" \ 1096 "\n -f Read PATTERN from file" \
1095 " -o Show only the part of a line that matches PATTERN\n" \ 1097 "\n -o Show only the part of a line that matches PATTERN" \
1096 " -e PATTERN is a regular expression\n" \ 1098 USE_DESKTOP( \
1097 " -F PATTERN is a set of newline-separated strings" \ 1099 "\n -w Match whole words only") \
1100 "\n -e PATTERN is a regular expression" \
1101 "\n -F PATTERN is a set of newline-separated strings" \
1098 USE_FEATURE_GREP_EGREP_ALIAS( \ 1102 USE_FEATURE_GREP_EGREP_ALIAS( \
1099 "\n -E PATTERN is an extended regular expression") \ 1103 "\n -E PATTERN is an extended regular expression") \
1100 USE_FEATURE_GREP_CONTEXT( \ 1104 USE_FEATURE_GREP_CONTEXT( \
1101 "\n -A Print NUM lines of trailing context") \ 1105 "\n -A Print NUM lines of trailing context" \
1102 USE_FEATURE_GREP_CONTEXT( \ 1106 "\n -B Print NUM lines of leading context" \
1103 "\n -B Print NUM lines of leading context") \ 1107 "\n -C Print NUM lines of output context") \
1104 USE_FEATURE_GREP_CONTEXT( \
1105 "\n -C Print NUM lines of output context")
1106 1108
1107#define grep_example_usage \ 1109#define grep_example_usage \
1108 "$ grep root /etc/passwd\n" \ 1110 "$ grep root /etc/passwd\n" \