bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-grep] --include / --exclude


From: Benno Schulenberg
Subject: Re: [bug-grep] --include / --exclude
Date: Fri, 3 Dec 2004 13:05:40 +0100
User-agent: KMail/1.7.1

Stepan Kasal wrote:
> On Wed, Dec 01, 2004 at 06:45:32PM +0000, Julian Foad wrote:
> > Bug #11017 doesn't explain why we would
> > want "--exclude" to exclude specified directories but would not
> > want "--include" to exclude non-specified directories.
>
> Bug #11017 is a reminder for me.  A long explanation is attached
> to patch #3521.  In short, I want that
>
>  grep -r pat --include='*.c' 
> and
>  grep -r pat --exclude='.svn'
>
> both work as the user would expected.

But my expectations are that if --include='*.c' does not search only 
those directories that happen to end in ".c", then --exclude='.svn' 
does not exclude any directories.

The --include and --exclude options should be symmetrical, for my 
taste.  I would be sour if a grep -r pattern --exclude='*py' would 
exclude some subdir that happened to be called "copy".

(If you want the ability to exclude dirs, then go with the #3521 
patch and get the ability to include only certain dirs too.)

Benno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]