From owner-freebsd-current@FreeBSD.ORG Sat Jul 24 04:19:28 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94E131065673 for ; Sat, 24 Jul 2010 04:19:28 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3585B8FC1B for ; Sat, 24 Jul 2010 04:19:27 +0000 (UTC) Received: (qmail 17011 invoked by uid 399); 24 Jul 2010 04:19:27 -0000 Received: from localhost (HELO laptop.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 24 Jul 2010 04:19:27 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Date: Fri, 23 Jul 2010 21:19:24 -0700 (PDT) From: Doug Barton To: Gabor Kovesdan Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: freebsd-current@FreeBSD.org Subject: [bsdgrep] grep -ql does not supress output X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2010 04:19:28 -0000 There are several places in portmaster where I use '[e]grep -ql ' 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