Subject: bug#44959: date error message should say -I

From: Bernhard Voelker <[email-masked]>
Date: Mon, 30 Nov 2020 14:40:24 +0100

On 11/30/20 2:13 PM, 積丹尼 Dan Jacobson wrote:
> $ date -I=seconds
> date: invalid argument ‘=seconds’ for ‘--iso-8601’

Hmm, first of all, 'date' 8.32 outputs more than the above:

  $ date -I=seconds
  date: invalid argument '=seconds' for '--iso-8601'
  Valid arguments are:
    - 'hours'
    - 'minutes'
    - 'date'
    - 'seconds'
    - 'ns'
  Try 'date --help' for more information.

> Hey, that is a valid argument for --iso-8601. (But not for -I, so say
> that instead.)
...
> date (GNU coreutils) 8.32

>From the above error message and from the --help output, one can see that
the -I option does not require the argument to be appended with "=FMT" but
just "FMT":

  $ date --help | grep -- -I
    -I[FMT], --iso-8601[=FMT]  output date/time in ISO 8601 format.

So, I'd say 'date' works as expected:

  $ date -Iseconds
  2020-11-30T14:38:35+01:00

Have a nice day,
Berny