summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-10-03 12:41:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-10-03 12:42:46 -0700
commit3320f8db4c7205e213dac6bc8b11ecca9de58ac0 (patch)
treeaad9e59696de812dff6ab1542930cd0de9aaf8c2 /doc
parentc1bd3a955fdc2b95f9267a9a83e475b4e924c2f2 (diff)
downloadgrep-3320f8db4c7205e213dac6bc8b11ecca9de58ac0.tar.gz
doc: document --include/--exclude better
Problem reported by John Ruckstuhl (Bug#43782). * doc/grep.texi (File and Directory Selection): Document what happens if contradictory options are given, or if no option matches a file name. * doc/grep.in.1:
Diffstat (limited to 'doc')
-rw-r--r--doc/grep.in.111
-rw-r--r--doc/grep.texi4
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index 91c0bcac..7d5dfe5a 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -680,6 +680,17 @@ Search only files whose base name matches
.I GLOB
(using wildcard matching as described under
.BR \-\^\-exclude ).
+If contradictory
+.B \-\^\-include
+and
+.B \-\^\-exclude
+options are given, the last matching one wins.
+If no
+.B \-\^\-include
+or
+.B \-\^\-exclude
+options match, a file is included unless the first such option is
+.BR \-\^\-include .
.TP
.BR \-r ", " \-\^\-recursive
Read all files under each directory, recursively,
diff --git a/doc/grep.texi b/doc/grep.texi
index bb76ae10..0c0bb124 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -728,6 +728,10 @@ this is equivalent to the @samp{--binary-files=without-match} option.
@cindex searching directory trees
Search only files whose name matches @var{glob},
using wildcard matching as described under @option{--exclude}.
+If contradictory @option{--include} and @option{--exclude} options are
+given, the last matching one wins. If no @option{--include} or
+@option{--exclude} options match, a file is included unless the first
+such option is @option{--include}.
@item -r
@itemx --recursive