summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-02-12 13:43:01 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-02-12 13:43:35 -0800
commit96e100ad23ec85bf602064298bf86b22cb358525 (patch)
tree34d20dd81fd4fcf4c2436567306f82a0da1b4a86
parenta0f9c60d4e90c34520b291b063ed02c71d3acc80 (diff)
downloadgrep-96e100ad23ec85bf602064298bf86b22cb358525.tar.gz
doc: clarify default input (Bug#25651)
* doc/grep.in.1: * src/grep.c (usage): Clarify default input when -r. * src/grep.c (usage): Do not bother documenting egrep and fgrep; the manual is enough.
-rw-r--r--doc/grep.in.120
-rw-r--r--src/grep.c16
2 files changed, 18 insertions, 18 deletions
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index e3472f7a..ed6382bf 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -43,15 +43,19 @@ grep, egrep, fgrep \- print lines matching a pattern
.
.SH DESCRIPTION
.B grep
-searches the named input
-.IR FILE s
-for lines containing a match to the given
-.IR PATTERN .
-If no files are specified, or if the file
+searches for
+.I PATTERN
+in each
+.IR FILE .
+A
+.I FILE
+of
.RB "\*(lq" \- "\*(rq"
-is given,
-.B grep
-searches standard input.
+stands for standard input.
+If no
+.I FILE
+is given, recursive searches examine the working directory,
+and nonrecursive searches read standard input.
By default,
.B grep
prints the matching lines.
diff --git a/src/grep.c b/src/grep.c
index 74acb0b2..5bc4cd5e 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1928,16 +1928,15 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... PATTERN [FILE]...\n"), getprogname ());
- printf (_("Search for PATTERN in each FILE or standard input.\n"));
- printf (_("PATTERN is, by default, a basic regular expression (BRE).\n"));
+ printf (_("Search for PATTERN in each FILE.\n"));
printf (_("\
Example: %s -i 'hello world' menu.h main.c\n\
\n\
-Regexp selection and interpretation:\n"), getprogname ());
+Pattern selection and interpretation:\n"), getprogname ());
printf (_("\
- -E, --extended-regexp PATTERN is an extended regular expression (ERE)\n\
+ -E, --extended-regexp PATTERN is an extended regular expression\n\
-F, --fixed-strings PATTERN is a set of newline-separated strings\n\
- -G, --basic-regexp PATTERN is a basic regular expression (BRE)\n\
+ -G, --basic-regexp PATTERN is a basic regular expression (default)\n\
-P, --perl-regexp PATTERN is a Perl regular expression\n"));
/* -X is deliberately undocumented. */
printf (_("\
@@ -2011,11 +2010,8 @@ Context control:\n\
(MSDOS/Windows)\n\
\n"));
printf (_("\
-'egrep' means 'grep -E'. 'fgrep' means 'grep -F'.\n\
-Direct invocation as either 'egrep' or 'fgrep' is deprecated.\n"));
- printf (_("\
-When FILE is -, read standard input. With no FILE, read . if a command-line\n\
--r is given, - otherwise. If fewer than two FILEs are given, assume -h.\n\
+When FILE is '-', read standard input. With no FILE, read '.' if\n\
+recursive, '-' otherwise. With fewer than two FILEs, assume -h.\n\
Exit status is 0 if any line is selected, 1 otherwise;\n\
if any error occurs and -q is not given, the exit status is 2.\n"));
emit_bug_reporting_address ();