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.

Have a nice day,
Berny
From 24a6f550737d9d68b861bc43c3cabe11a6d21eca Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <[email protected]>
Date: Sat, 15 Nov 2025 16:39:26 +0100
Subject: [PATCH] du: document the TIME_STYLE env variable in usage

The impact of the TIME_STYLE environment variable on du(1) is only
documented in the Texinfo manual.  To avoid surprises for users,
also mention it in the usage text, i.e., for --help and man.

* src/du.c (usage): Document the environment variable.
---
 src/du.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/du.c b/src/du.c
index f4dbd8c05..0d448cee7 100644
--- a/src/du.c
+++ b/src/du.c
@@ -349,6 +349,10 @@ 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 environment variable TIME_STYLE sets the style for --time output\n\
+when the --time-style option is not given.\n\
+"), stdout);
       emit_ancillary_info (PROGRAM_NAME);
     }
   exit (status);
-- 
2.51.1

Reply via email to