From owner-dev-commits-src-branches@freebsd.org Sun Aug 15 21:15:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25257666C0E; Sun, 15 Aug 2021 21:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GnqpK0QlJz4f6H; Sun, 15 Aug 2021 21:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB99B1D40C; Sun, 15 Aug 2021 21:15:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17FLFqY6020273; Sun, 15 Aug 2021 21:15:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17FLFqZe020272; Sun, 15 Aug 2021 21:15:52 GMT (envelope-from git) Date: Sun, 15 Aug 2021 21:15:52 GMT Message-Id: <202108152115.17FLFqZe020272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 90146cfa3180 - stable/12 - grep: Fix an incorrect description of the -C flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 90146cfa3180ee6f8e183f3fb31cdde2e4fc6417 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2021 21:15:53 -0000 The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=90146cfa3180ee6f8e183f3fb31cdde2e4fc6417 commit 90146cfa3180ee6f8e183f3fb31cdde2e4fc6417 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-02-05 18:38:09 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-08-15 21:08:29 +0000 grep: Fix an incorrect description of the -C flag It seems that the number of lines is no longer an optional parameter to the -C flag. Document it accordingly both in the manual page and the usage message. Reviewed by: yuripv Approved by: yuripv MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28509 (cherry picked from commit be6b8b7a3a18acb3b044e144d946392fca05e5d0) --- usr.bin/grep/grep.1 | 21 +++++++++------------ usr.bin/grep/grep.c | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index 9aac1cc6ca92..af3aec95cb19 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd February 11, 2021 +.Dd April 17, 2021 .Dt GREP 1 .Os .Sh NAME @@ -45,13 +45,13 @@ .Op Fl abcdDEFGHhIiLlmnOopqRSsUVvwxz .Op Fl A Ar num .Op Fl B Ar num -.Op Fl C Ns Op Ar num +.Op Fl C Ar num .Op Fl e Ar pattern .Op Fl f Ar file .Op Fl Fl binary-files= Ns Ar value .Op Fl Fl color Ns Op Cm = Ns Ar when .Op Fl Fl colour Ns Op Cm = Ns Ar when -.Op Fl Fl context Ns Op Cm = Ns Ar num +.Op Fl Fl context= Ns Ar num .Op Fl Fl label .Op Fl Fl line-buffered .Op Fl Fl null @@ -123,18 +123,15 @@ options. .It Fl b , Fl Fl byte-offset The offset in bytes of a matched pattern is displayed in front of the respective matched line. -.It Fl C Ns Oo Ar num Oc , Fl Fl context Ns Oo = Ns Ar num Oc +.It Fl C Ar num , Fl Fl context= Ns Ar num Print .Ar num lines of leading and trailing context surrounding each match. -The default value of -.Ar num -is -.Dq 2 -and is equivalent to -.Dq Fl A Ar 2 Fl B Ar 2 . -Note: -no whitespace may be given between the option and its argument. +See also the +.Fl A +and +.Fl B +options. .It Fl c , Fl Fl count Only a count of selected lines is written to standard output. .It Fl Fl colour= Ns Oo Ar when Oc , Fl Fl color= Ns Oo Ar when Oc diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index a9c67c268b47..b9dc97661fd6 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -57,9 +57,9 @@ const char *errstr[] = { "", /* 1*/ "(standard input)", /* 2*/ "unknown %s option", -/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n", +/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C num]\n", /* 4*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", -/* 5*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n", +/* 5*/ "\t[--context=num] [--directories=action] [--label] [--line-buffered]\n", /* 6*/ "\t[--null] [pattern] [file ...]\n", /* 7*/ "Binary file %s matches\n", /* 8*/ "%s (BSD grep) %s\n",