diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2014-07-11 13:21:19 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-07-11 13:22:00 -0700 |
commit | 846fe088f835d481fc1b237f5c24e336a317d112 (patch) | |
tree | 3255c8fba79ff375fbf11713e2f83f02262b0e1f | |
parent | 09434c399629d16bc4fceb443aa3e5cea412f4ea (diff) | |
download | grep-846fe088f835d481fc1b237f5c24e336a317d112.tar.gz |
doc: Document -r vs --exclude more carefully.
Problem reported by Hugues Andreux in: http://bugs.gnu.org/17763
* doc/grep.texi (File and Directory Selection): Be more careful
about documenting the interaction between recursive searching,
--include, --exclude, and --exclude-dir.
-rw-r--r-- | doc/grep.texi | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/grep.texi b/doc/grep.texi index 6c484d69..01155603 100644 --- a/doc/grep.texi +++ b/doc/grep.texi @@ -651,9 +651,10 @@ this is equivalent to the @option{-r} option. @opindex --exclude @cindex exclude files @cindex searching directory trees -Skip files whose base name matches @var{glob} -(using wildcard matching). -A file-name glob can use +Skip files whose name matches the pattern @var{glob}, using wildcard +matching. When searching recursively, skip any subfile whose base +name matches @var{glob}; the base name is the part after the last +@samp{/}. A pattern can use @samp{*}, @samp{?}, and @samp{[}...@samp{]} as wildcards, and @code{\} to quote a wildcard or backslash character literally. @@ -661,15 +662,16 @@ and @code{\} to quote a wildcard or backslash character literally. @opindex --exclude-from @cindex exclude files @cindex searching directory trees -Skip files whose base name matches any of the file-name globs +Skip files whose name matches any of the patterns read from @var{file} (using wildcard matching as described under @option{--exclude}). -@item --exclude-dir=@var{dir} +@item --exclude-dir=@var{glob} @opindex --exclude-dir @cindex exclude directories -Skip any directory whose name matches the pattern @var{dir}, ignoring -any redundant trailing slashes in @var{dir}. +Skip any directory whose name matches the pattern @var{glob}. When +searching recursively, skip any subdirectory whose base name matches +@var{glob}. Ignore any redundant trailing slashes in @var{glob}. @item -I Process a binary file as if it did not contain matching data; @@ -679,8 +681,8 @@ this is equivalent to the @samp{--binary-files=without-match} option. @opindex --include @cindex include files @cindex searching directory trees -Search only files whose base name matches @var{glob} -(using wildcard matching as described under @option{--exclude}). +Search only files whose name matches @var{glob}, +using wildcard matching as described under @option{--exclude}. @item -r @itemx --recursive |