bug#79113: du --time-styles inconsistencies between manual and behaviour

Nicolas Boichat <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <CAM6NUi7BXbBsDqA-OmBUShmV=Mdp4m7LkJFFW0zEmKGTjNyvcA@mail.gmail.com>
Hi,

Version: env du --version => du (GNU coreutils) 9.7
OS: archlinux, x86-64

The GNU coreutils manual says
(https://www.gnu.org/software/coreutils/manual/coreutils.html#index-_002d_002dtime_002dstyle-1):
- "You can specify the default value of the --time-style option with
the environment variable TIME_STYLE; if TIME_STYLE is not set the
default style is ‘long-iso’." -> yes
- "For compatibility with ls, if TIME_STYLE begins with ‘+’ and
contains a newline, the newline and any later characters are ignored;"

That does not match behaviour, newlines are just used as-is:
```
$ env du --time --time-style="$(printf "+xyz\nabc")" blob
96 xyz
abc blob
```

- "if TIME_STYLE begins with ‘posix-’ the ‘posix-’ is ignored; and if
TIME_STYLE is ‘locale’ it is ignored."

Also doesn't match, `posix-` is not allowed, `locale` is not allowed:
```
$ env du --time --time-style=posix-iso blob
du: invalid argument ‘posix-iso’ for ‘time style’
Valid arguments are:
  - ‘full-iso’
  - ‘long-iso’
  - ‘iso’
Try 'du --help' for more information.
$ env du --time --time-style=locale blob
du: invalid argument ‘locale’ for ‘time style’
Valid arguments are:
  - ‘full-iso’
  - ‘long-iso’
  - ‘iso’
Try 'du --help' for more information.
```

Finally, the help text doesn't mention that +FORMAT is allowed.

Thanks!

Nicolas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.