From owner-svn-src-head@freebsd.org Wed Apr 25 16:28:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B157BFA9F8E; Wed, 25 Apr 2018 16:28:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621176BC8D; Wed, 25 Apr 2018 16:28:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58A683B8A; Wed, 25 Apr 2018 16:28:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PGSpkW027940; Wed, 25 Apr 2018 16:28:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PGSpYM027939; Wed, 25 Apr 2018 16:28:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804251628.w3PGSpYM027939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Apr 2018 16:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333001 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 333001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 16:28:51 -0000 Author: kevans Date: Wed Apr 25 16:28:51 2018 New Revision: 333001 URL: https://svnweb.freebsd.org/changeset/base/333001 Log: bsdgrep(1): Sneak in some man page updates - The --exclude{,-dir} and --include{,-dir} directives now match GNU behavior of being processed in order and latest matching directive wins - --label was previously not really documented, and -L and -l did not indicate that --label applied to them - The flags listed as being extensions to POSIX spec were not updated with the removal of compression-related flags MFC after: 1 week Modified: head/usr.bin/grep/grep.1 Modified: head/usr.bin/grep/grep.1 ============================================================================== --- head/usr.bin/grep/grep.1 Wed Apr 25 15:41:50 2018 (r333000) +++ head/usr.bin/grep/grep.1 Wed Apr 25 16:28:51 2018 (r333001) @@ -175,9 +175,11 @@ If specified, it excludes files matching the given filename pattern from the search. Note that .Fl Fl exclude -patterns take priority over +and .Fl Fl include -patterns, and if no +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. +If no .Fl Fl include pattern is specified, all files are searched that are not excluded. @@ -190,9 +192,11 @@ is specified, it excludes directories matching the given filename pattern from the search. Note that .Fl Fl exclude-dir -patterns take priority over +and .Fl Fl include-dir -patterns, and if no +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. +If no .Fl Fl include-dir pattern is specified, all directories are searched that are not excluded. @@ -242,10 +246,11 @@ is case sensitive. If specified, only files matching the given filename pattern are searched. Note that -.Fl Fl exclude -patterns take priority over .Fl Fl include -patterns. +and +.Fl Fl exclude +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. Patterns are matched to the full path specified, not only to the filename component. .It Fl Fl include-dir @@ -254,17 +259,20 @@ If is specified, only directories matching the given filename pattern are searched. Note that -.Fl Fl exclude-dir -patterns take priority over .Fl Fl include-dir -patterns. +and +.Fl Fl exclude-dir +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. .It Fl L , Fl Fl files-without-match Only the names of files not containing selected lines are written to standard output. Pathnames are listed once per file searched. If the standard input is searched, the string .Dq (standard input) -is written. +is written unless a +.Fl Fl label +is specified. .It Fl l , Fl Fl files-with-matches Only the names of files containing selected lines are written to standard output. @@ -274,7 +282,18 @@ making searches potentially less expensive. Pathnames are listed once per file searched. If the standard input is searched, the string .Dq (standard input) -is written. +is written unless a +.Fl Fl label +is specified. +.It Fl Fl label +Label to use in place of +.Dq (standard input) +for a file name where a file name would normally be printed. +This option applies to +.Fl H , +.Fl L , +and +.Fl l . .It Fl Fl mmap Use .Xr mmap 2 @@ -450,7 +469,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl AaBbCDdGHhIJLmoPRSUVwZ +.Op Fl AaBbCDdGHhILmoPRSUVw are extensions to that specification, and the behaviour of the .Fl f flag when used with an empty pattern file is left undefined.