Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jul 2010 21:19:24 -0700 (PDT)
From:      Doug Barton <dougb@FreeBSD.org>
To:        Gabor Kovesdan <gabor@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.org
Subject:   [bsdgrep] grep -ql does not supress output
Message-ID:  <alpine.BSF.2.00.1007232052210.1697@qbhto.arg>

next in thread | raw e-mail | index | archive | help
There are several places in portmaster where I use '[e]grep -ql <foo>' 
to signal existence of something without having to deal with the output 
of grep. In oldgrep this worked as advertised. In bsdgrep it doesn't.

Furthermore, looking at the code it doesn't seem like it's a trivial fix 
since you seem to be conflating the idea of -q with "don't output the 
matching lines" instead of "don't output anything" which is what the old 
one did:

                 case 'l':
                         Lflag = false;
                         lflag = qflag = true;
                         break;

Also, looking at the code it's not clear to me that the -q option has 
its previous behavior of halting processing for that file on the first 
match, but I've only given it a quick look.

So, request number 1, fix it so that bsdgrep -ql doesn't output 
anything, and make sure that -q actually halts processing on the first 
match.

Request number 2, think about whether or not introducing this as the 
default was the right course of action. I held my tongue on this when 
you committed it, but in the past when such things have been added they 
start life as an option, allowing those who choose to do so to 
regression test them. Once they've had a shakeout period THEN the switch 
is flipped to make them the default. I'm not at the point yet where I'm 
ready to ask for you to change this, but between the color thing and 
this issue, that ball has started to roll, in my mind at least. We'll 
see what happens with more testing.


Thanks,

Doug

-- 

 	Improve the effectiveness of your Internet presence with
 	a domain name makeover!    http://SupersetSolutions.com/

 	Computers are useless. They can only give you answers.
 			-- Pablo Picasso




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1007232052210.1697>