On 15/11/2025 20:16, Bernhard Voelker wrote:
On 11/15/25 21:00, Pádraig Brady wrote:
On 15/11/2025 15:43, Bernhard Voelker wrote:
I know we want to keep --help output short, but I find it useful to see
the TIME_STYLE in usage output, as it might avoid confusion.
Unfortunately, I didn't find a nice 1-liner ... which could then go close
to the description of the --time-style option.
Actually how about using the same --help as ls.
In that way the explanation is more accurate,
and translations are shared?
I'd like to ... but:
du(1) is handling --time-style a bit different than ls(1):
the latter supports "posix-" prefixes, and du(1) ignores TIME_STYLE='locale'.
WDYT?
Ah right, they're sufficiently different to avoid trying to share translations.
Though I think the organization of ls --help is a bit better.
How about something like:
diff --git a/src/du.c b/src/du.c
index f4dbd8c05..d1c0d5d2b 100644
--- a/src/du.c
+++ b/src/du.c
@@ -336,9 +336,9 @@ Summarize device usage of the set of FILEs, recursively for
directories.\n\
directory, or any of its subdirectories\n\
--time=WORD show time as WORD instead of modification time:\n\
atime, access, use, ctime or status\n\
- --time-style=STYLE show times using STYLE, which can be:\n\
- full-iso, long-iso, iso, or +FORMAT;\n\
- FORMAT is interpreted like in 'date'\n\
+"), stdout);
+ fputs (_("\
+ --time-style=STYLE time/date display format; see TIME_STYLE below\n\
"), stdout);
fputs (_("\
-X, --exclude-from=FILE exclude files that match any pattern in FILE\n\
@@ -349,6 +349,12 @@ Summarize device usage of the set of FILEs, recursively
for directories.\n\
fputs (VERSION_OPTION_DESCRIPTION, stdout);
emit_blocksize_note ("DU");
emit_size_note ();
+ fputs (_("\
+\n\
+The --time-style STYLE argument can be full-iso, long-iso, iso, or +FORMAT.\n\
+FORMAT is interpreted like in date(1).\n\
+Also the TIME_STYLE environment variable sets the default style to use.\n\
+"), stdout);
emit_ancillary_info (PROGRAM_NAME);
}
exit (status);
Feel free to adjust and push in your name as you think best.
cheers,
Padraig