GNU bug report logs -
#63030
Minor innacuracy on --exclude documentation?
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#63030: Minor innacuracy on --exclude documentation?
which was filed against the grep package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 63030 <at> debbugs.gnu.org.
--
63030: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63030
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
tags 63030 notabug
done
On Sun, Apr 23, 2023 at 5:05 AM Sebastian Carlos <sebaaa1754 <at> gmail.com> wrote:
> On second thought, I think the documentation is fine. I just misread it. It
> has two sentences: "Skip any COMMAND-LINE file with..." and "When searching
> recursively, skip any SUBFILE whose...". So both cases are considered and
> it doesn't imply that --exclude acts on command line files only.
Thanks for the follow-up.
This email closes the issue in our tracker.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Hello,
The current version of the --exclude documentation says the following:
```
‘--exclude=GLOB’
Skip any command-line file with a name suffix that matches the
pattern GLOB, using wildcard matching; a name suffix is either the
whole name, or a trailing part that starts with a non-slash
character immediately after a slash (‘/’) in the name. When
searching recursively, skip any subfile whose base name matches
GLOB; the base name is the part after the last slash. A pattern
can use ‘*’, ‘?’, and ‘[’...‘]’ as wildcards, and ‘\’ to quote a
wildcard or backslash character literally.
```
I think that "Skip any command-line file" should be replaced with "Skip any
file", because --exclude does work even if files are not provided as
explicit
command-line arguments (for example, when using -r).
While it could be ambiguous, this interpretation of "command-line file"
meaning "files explicitly provided as command-line arguments" is consistent
with the documentation for --devices, which makes an explicit distinction
between "command-line devices" and "devices that are encountered
recursively":
```
‘-D ACTION’
‘--devices=ACTION’
If an input file is a device, FIFO, or socket, use ACTION to
process it. If ACTION is ‘read’, all devices are read just as if
they were ordinary files. If ACTION is ‘skip’, devices, FIFOs, and
sockets are silently skipped. By default, devices are read if they
are on the command line or if the ‘-R’ (‘--dereference-recursive’)
option is used, and are skipped if they are encountered recursively
and the ‘-r’ (‘--recursive’) option is used. This option has no
effect on a file that is read via standard input.
```
Another significant argument in favor of the proposed change is that the
similar --include option doesn't mention "command-line files":
```
‘--include=GLOB’
Search only files whose name matches GLOB, using wildcard matching
as described under ‘--exclude’. If contradictory ‘--include’ and
‘--exclude’ options are given, the last matching one wins. If no
‘--include’ or ‘--exclude’ options match, a file is included unless
the first such option is ‘--include’.
```
[Message part 5 (text/html, inline)]
This bug report was last modified 2 years and 87 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.