On Tue, Oct 12, 2021 at 10:20:28AM -0700, Michael Partridge wrote:
> Hello,
> I am reading the date man page for the first time and it seems that a `+`
> must prefix a format string, but this requirement or behavior is not
> documented.
It is, although you may have missed it.
$ date --help |head -n1
Usage: date [OPTION]... [+FORMAT]
>
> I think this default format string should appear in the man page as
> well.
It already does (since the man page is generated from the --help output):
NAME
date - print or set the system date and time
SYNOPSIS
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
In both places, the argument is written +FORMAT to make it obvious
that without a leading +, you are instead asking date to parse a
'MMDDhhmm' argument for setting the system date (likely to fail if not
executed as root).
That said, if you have a proposed patch to make the existing
documentation clearer, we're open to the idea.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org