Index: ChangeLog =================================================================== RCS file: /cvsroot/grep/grep/ChangeLog,v retrieving revision 1.207 diff -u -r1.207 ChangeLog --- ChangeLog 23 Nov 2004 12:49:36 -0000 1.207 +++ ChangeLog 2 Dec 2004 09:27:32 -0000 @@ -1,3 +1,16 @@ +2004-12-01 Stepan Kasal + + * src/grep.c (usage): Use ``FILE_PATTERN'' for --include and --exclude, + change ``only print'' to ``print only''. + * doc/grep.1: Likewise; state that wildcard matching is used. + * dfa.c, NEWS: Fix typos. + +2004-11-28 Benno Schulenberg (tiny change) + + * src/grep.c (usage): Clean up several details in the usage string. + * doc/grep.1: Fix descriptions of --include and --exclude. + * doc/grep.texi: Likewise. + 2004-11-23 Stepan Kasal * src/Makefile.am: The egrep and fgrep script now use their own @@ -12,7 +25,7 @@ * src/grep.c (usage): Make sure both copies of the ``usage'' strings match. Add ``(C)'' to the copyright notice. - * src/dfa.c: Changed "out of memory" to "memory exhausted" to + * src/dfa.c: Changed ``out of memory'' to ``memory exhausted'' to match messages elsewhere in the source. 2004-11-22 Stepan Kasal @@ -66,7 +79,7 @@ * tests/spencer1.awk: Use only lines with 3 fields. * tests/spencer1.tests: Disable #55 for now. - * tests/ere.tests, tests/bre.tests: Add "TO CORRECT" to disabled + * tests/ere.tests, tests/bre.tests: Add ``TO CORRECT'' to disabled tests which had empty $4. * tests/backref.sh: Modify #2 so that current glibc regex can handle it in finite time. @@ -100,7 +113,7 @@ * src/dfa.c: remove non-constant initializers from dfa.c 2003-06-16 Stepan Kasal - * doc/grep.1: two typos "--line-buffered [...] penalty" + * doc/grep.1: two typos ``--line-buffered [...] penalty'' * doc/grep.texi: a typo 2003-06-12 Bernhard Rosenkraenzer Index: NEWS =================================================================== RCS file: /cvsroot/grep/grep/NEWS,v retrieving revision 1.38 diff -u -r1.38 NEWS --- NEWS 26 Mar 2002 15:37:07 -0000 1.38 +++ NEWS 2 Dec 2004 09:27:32 -0000 @@ -28,7 +28,7 @@ grep -e '\(a\)\1' -e '\(b\)\1' The last backref \1 in the second expression refer to \(b\) - - The new option --include=PATTERN will only search matching files + - The new option --include=PATTERN will search only matching files when recursing in directories - The new option --exclude=PATTERN will skip matching files when Index: doc/grep.1 =================================================================== RCS file: /cvsroot/grep/grep/doc/grep.1,v retrieving revision 1.25 diff -u -r1.25 grep.1 --- doc/grep.1 19 Nov 2004 13:51:29 -0000 1.25 +++ doc/grep.1 2 Dec 2004 09:27:32 -0000 @@ -186,6 +186,9 @@ as the pattern; useful to protect patterns beginning with .BR \- . .TP +.BI \-\^\-exclude= FILE_PATTERN +.RI "Skip files " "and directories" " that match " FILE_PATTERN. +.TP .BR \-F ", " \-\^\-fixed-strings Interpret .I PATTERN @@ -228,6 +231,11 @@ .I PATTERN and the input files. .TP +.BI \-\^\-include= FILE_PATTERN +Search only files that match +.I FILE_PATTERN +(using wildcard matching). +.TP .BR \-L ", " \-\^\-files-without-match Suppress normal output; instead print the name of each input file from which no output would @@ -321,14 +329,6 @@ .B "\-d recurse" option. .TP -.BR "\fR \fP \-\^\-include=" PATTERN -Recurse in directories only searching file matching -.I PATTERN. -.TP -.BR "\fR \fP \-\^\-exclude=" PATTERN -Recurse in directories skip file matching -.I PATTERN. -.TP .BR \-s ", " \-\^\-no-messages Suppress error messages about nonexistent or unreadable files. Portability note: unlike \s-1GNU\s0 Index: doc/grep.texi =================================================================== RCS file: /cvsroot/grep/grep/doc/grep.texi,v retrieving revision 1.47 diff -u -r1.47 grep.texi --- doc/grep.texi 19 Nov 2004 13:51:29 -0000 1.47 +++ doc/grep.texi 2 Dec 2004 09:27:32 -0000 @@ -416,14 +416,13 @@ @opindex --include @cindex include files @cindex searching directory trees -When processing directories recursively, only files matching @var{file_pattern} -will be search. +Search only files matching @var{file_pattern}. @item address@hidden @opindex --exclude @cindex exclude files @cindex searching directory trees -When processing directories recursively, skip files matching @var{file_pattern}. +Skip files @emph{and directories} matching @var{file_pattern}. @item -m @var{num} @itemx address@hidden Index: src/dfa.c =================================================================== RCS file: /cvsroot/grep/grep/src/dfa.c,v retrieving revision 1.28 diff -u -r1.28 dfa.c --- src/dfa.c 23 Nov 2004 10:00:48 -0000 1.28 +++ src/dfa.c 2 Dec 2004 09:27:33 -0000 @@ -2733,7 +2733,7 @@ if (nelem == 0 || maxlen == 0) /* This state has no multibyte operator which can match. - We need to check only one singlebyte character. */ + We need to check only one singlebyte character. */ { status_transit_state rs; rs = transit_state_singlebyte(d, s, *pp, &s1); Index: src/grep.c =================================================================== RCS file: /cvsroot/grep/grep/src/grep.c,v retrieving revision 1.86 diff -u -r1.86 grep.c --- src/grep.c 23 Nov 2004 10:00:48 -0000 1.86 +++ src/grep.c 2 Dec 2004 09:27:33 -0000 @@ -677,7 +677,7 @@ --p; while (p[-1] != eol); - /* We only print the "--" separator if our output is + /* We print the "--" separator only if our output is discontiguous from the last output in the file. */ if ((out_before || out_after) && used && p != lastout) puts ("--"); @@ -1123,21 +1123,21 @@ --label=LABEL print LABEL as filename for standard input\n\ -o, --only-matching show only the part of a line matching PATTERN\n\ -q, --quiet, --silent suppress all normal output\n\ - --binary-files=TYPE assume that binary files are TYPE\n\ - TYPE is 'binary', 'text', or 'without-match'\n\ + --binary-files=TYPE assume that binary files are TYPE;\n\ + TYPE is `binary', `text', or `without-match'\n\ -a, --text equivalent to --binary-files=text\n\ -I equivalent to --binary-files=without-match\n\ - -d, --directories=ACTION how to handle directories\n\ - ACTION is 'read', 'recurse', or 'skip'\n\ - -D, --devices=ACTION how to handle devices, FIFOs and sockets\n\ - ACTION is 'read' or 'skip'\n\ + -d, --directories=ACTION how to handle directories;\n\ + ACTION is `read', `recurse', or `skip'\n\ + -D, --devices=ACTION how to handle devices, FIFOs and sockets;\n\ + ACTION is `read' or `skip'\n\ -R, -r, --recursive equivalent to --directories=recurse\n\ - --include=PATTERN files that match PATTERN will be examined\n\ - --exclude=PATTERN files that match PATTERN will be skipped.\n\ - --exclude-from=FILE files that match PATTERN in FILE will be skipped.\n\ - -L, --files-without-match only print FILE names containing no match\n\ - -l, --files-with-matches only print FILE names containing matches\n\ - -c, --count only print a count of matching lines per FILE\n\ + --include=FILE_PATTERN search only files that match FILE_PATTERN\n\ + --exclude=FILE_PATTERN skip files and directories matching FILE_PATTERN\n\ + --exclude-from=FILE skip files matching any file pattern from FILE\n\ + -L, --files-without-match print only names of FILEs containing no match\n\ + -l, --files-with-matches print only names of FILEs containing matches\n\ + -c, --count print only a count of matching lines per FILE\n\ -Z, --null print 0 byte after FILE name\n")); printf (_("\ \n\ @@ -1147,15 +1147,15 @@ -C, --context=NUM print NUM lines of output context\n\ -NUM same as --context=NUM\n\ --color[=WHEN],\n\ - --colour[=WHEN] use markers to distinguish the matching string\n\ - WHEN may be `always', `never' or `auto'.\n\ + --colour[=WHEN] use markers to distinguish the matching string;\n\ + WHEN may be `always', `never', or `auto'\n\ -U, --binary do not strip CR characters at EOL (MSDOS)\n\ -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS)\n\ \n\ `egrep' means `grep -E'. `fgrep' means `grep -F'.\n\ -With no FILE, or when FILE is -, read standard input. If less than\n\ -two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n\ -and 2 if trouble.\n")); +With no FILE, or when FILE is -, standard input is read. If less than two\n\ +FILEs are given, -h is assumed. Exit status is 0 if any line was selected,\n\ +1 otherwise; if any error occurs and -q was not given, the exit status is 2.\n")); printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); } exit (status);