From nobody Wed Nov 03 13:09:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 43ADB182F488; Wed, 3 Nov 2021 13:09:40 +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 4HknDN1QDtz4Yqn; Wed, 3 Nov 2021 13:09:40 +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 0C225195BC; Wed, 3 Nov 2021 13:09:40 +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 1A3D9deD041699; Wed, 3 Nov 2021 13:09:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A3D9d2J041698; Wed, 3 Nov 2021 13:09:39 GMT (envelope-from git) Date: Wed, 3 Nov 2021 13:09:39 GMT Message-Id: <202111031309.1A3D9d2J041698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 00133d5c5e6a - main - date.1: Fix some style issues and examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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/main X-Git-Reftype: branch X-Git-Commit: 00133d5c5e6aae01663eca40993abd5e6137425b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=00133d5c5e6aae01663eca40993abd5e6137425b commit 00133d5c5e6aae01663eca40993abd5e6137425b Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-03 10:26:46 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-03 13:09:18 +0000 date.1: Fix some style issues and examples - Use Cm instead of Ar or Sq for command modifiers of the -v flag. - Remove unnecessary "Ar ..." from the synopsis. It's not clear what it was referring to. - Add missing arguments to the -f and -v flags. - Stylize the dot before "ss" with Cm in the default format in the -f flag description. - Set LC_ALL=C in the last example so that the output format of date(1) always matches the specified format of the -f flag not matter the locale. - List the -f flag as optional in all usage lines in the synopsis. MFC after: 3 days --- bin/date/date.1 | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/bin/date/date.1 b/bin/date/date.1 index 8f187b311a82..05b180cceb2b 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 16, 2021 +.Dd November 3, 2021 .Dt DATE 1 .Os .Sh NAME @@ -46,10 +46,9 @@ .Fl v .Sm off .Op Cm + | - -.Ar val Op Ar ymwdHMS +.Ar val Op Cm y | m | w | d | H | M | S .Sm on .Oc -.Ar ... .Op Cm + Ns Ar output_fmt .Nm .Op Fl ju @@ -90,7 +89,7 @@ the time may not be changed by more than 1 second. .Pp The options are as follows: .Bl -tag -width Ds -.It Fl f +.It Fl f Ar input_fmt Use .Ar input_fmt as the format string to parse the @@ -103,7 +102,7 @@ provided rather than using the default .Ar mm Oc .Ar dd Oc .Ar HH -.Oc Ar MM Op Ar .ss +.Oc Ar MM Op Cm \&. Ar ss .Sm on format. Parsing is done using @@ -114,24 +113,24 @@ Use output format. .Ar FMT may be omitted, in which case the default is -.Sq date . +.Cm date . Valid .Ar FMT values are -.Sq date , -.Sq hours , -.Sq minutes , +.Cm date , +.Cm hours , +.Cm minutes , and -.Sq seconds . +.Cm seconds . The date and time is formatted to the specified precision. When .Ar FMT is -.Sq hours +.Cm hours (or the more precise -.Sq minutes +.Cm minutes or -.Sq seconds ) , +.Cm seconds ) , the .St -iso8601 format includes the timezone. @@ -175,7 +174,13 @@ Print the date and time of the last modification of Display or set the date in .Tn UTC (Coordinated Universal) time. -.It Fl v +.It Xo +.Fl v +.Sm off +.Op Cm + | - +.Ar val Op Cm y | m | w | d | H | M | S +.Sm on +.Xc Adjust (i.e., take the current date and display the result of the adjustment; not actually set the date) the second, minute, hour, month day, week day, month or year according to @@ -199,14 +204,14 @@ and years are in the range 80-38 or 1980-2038. If .Ar val is numeric, one of either -.Ar y , -.Ar m , -.Ar w , -.Ar d , -.Ar H , -.Ar M +.Cm y , +.Cm m , +.Cm w , +.Cm d , +.Cm H , +.Cm M or -.Ar S +.Cm S must be used to specify which part of the date is to be adjusted. .Pp The week day or month may be specified using a name rather than a @@ -420,7 +425,7 @@ will display .Pp Finally the command: .Pp -.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s""" +.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`LC_ALL=C date`"" ""+%s""" .Pp can be used to parse the output from .Nm