Pádraig Brady <[email protected]> writes:

> On 26/11/2025 07:28, Collin Funk wrote:
>> * src/date.c (usage): Mention that standard input will be read if
>> DATEFILE is "-".
>> Reported at https://bugs.debian.org/1100395
>> ---
>>   src/date.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>> diff --git a/src/date.c b/src/date.c
>> index 2b944e79f..eb65a7b72 100644
>> --- a/src/date.c
>> +++ b/src/date.c
>> @@ -146,7 +146,9 @@ With -s, or with [MMDDhhmm[[CC]YY][.ss]], set the date 
>> and time.\n\
>>                                 warn about questionable usage to standard 
>> error\n\
>>   "), stdout);
>>         fputs (_("\
>> -  -f, --file=DATEFILE        like --date; once for each line of DATEFILE\n\
>> +  -f, --file=DATEFILE        like --date; once for each line of DATEFILE;\n\
>> +                               If DATEFILE is - then read names from 
>> standard\n\
>> +                               input\n\
>
> Would it be better to remove the "then" to fit on one line?
>
>  If DATEFILE is -, read names from standard input
>
> +1 to both changes in any case.

Yep, that looks good to me.

Also, I prefer the comma there like in your suggested text. I only
removed it because the other occurrences in src/wc.c and src/du.c did
not have it. Most places online say the comma is optional when a
dependent clause precedes an independent clause. So I guess it is
something writers debate about, like the Oxford comma [1].

I pushed the attached patches instead. The first adjusts the
--files0-from descriptions to match each other. The second follows your
suggestion.

Collin

[1] https://en.wikipedia.org/wiki/Serial_comma

>From 5763d56e692207e5c51863e4cbbb0b2aae32bf23 Mon Sep 17 00:00:00 2001
Message-ID: <5763d56e692207e5c51863e4cbbb0b2aae32bf23.1764215593.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Wed, 26 Nov 2025 19:17:43 -0800
Subject: [PATCH v2 1/2] doc: du, sort, wc: adjust description of --files0-from

* src/du.c (usage): Remove an unnecessary "then".
* src/wc.c (usage): Likewise. Add a comma after "-".
* src/sort.c (usage): Likewise. Adjust the indentation to match du and
wc.
---
 src/du.c   | 2 +-
 src/sort.c | 4 ++--
 src/wc.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/du.c b/src/du.c
index 105acb2df..80d0b53d1 100644
--- a/src/du.c
+++ b/src/du.c
@@ -312,7 +312,7 @@ Summarize device usage of the set of FILEs, recursively for directories.\n\
       fputs (_("\
       --files0-from=F   summarize device usage of the\n\
                           NUL-terminated file names specified in file F;\n\
-                          if F is -, then read names from standard input\n\
+                          if F is -, read names from standard input\n\
   -H                    equivalent to --dereference-args (-D)\n\
   -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)\
 \n\
diff --git a/src/sort.c b/src/sort.c
index 671a953d2..26afc97ec 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -484,8 +484,8 @@ Other options:\n\
       --debug               annotate the part of the line used to sort, and\n\
                               warn about questionable usage to standard error\n\
       --files0-from=F       read input from the files specified by\n\
-                            NUL-terminated names in file F;\n\
-                            If F is - then read names from standard input\n\
+                              NUL-terminated names in file F;\n\
+                              If F is -, read names from standard input\n\
 "), stdout);
       fputs (_("\
   -k, --key=KEYDEF          sort via a key; KEYDEF gives location and type\n\
diff --git a/src/wc.c b/src/wc.c
index 6b46412fb..d2ffb03b3 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -194,7 +194,7 @@ the following order: newline, word, character, byte, maximum line length.\n\
       fputs (_("\
       --files0-from=F    read input from the files specified by\n\
                            NUL-terminated names in file F;\n\
-                           If F is - then read names from standard input\n\
+                           If F is -, read names from standard input\n\
   -L, --max-line-length  print the maximum display width\n\
   -w, --words            print the word counts\n\
 "), stdout);
-- 
2.52.0

>From 194176cddbfdfd9d26b9be14bd9cc18708fba488 Mon Sep 17 00:00:00 2001
Message-ID: <194176cddbfdfd9d26b9be14bd9cc18708fba488.1764215593.git.collin.fu...@gmail.com>
In-Reply-To: <5763d56e692207e5c51863e4cbbb0b2aae32bf23.1764215593.git.collin.fu...@gmail.com>
References: <5763d56e692207e5c51863e4cbbb0b2aae32bf23.1764215593.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Wed, 26 Nov 2025 19:27:07 -0800
Subject: [PATCH v2 2/2] doc: date: mention --file=- reads from standard input

* src/date.c (usage): Mention that standard input will be read if
DATEFILE is "-".
Reported at https://bugs.debian.org/1100395
---
 src/date.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/date.c b/src/date.c
index 2b944e79f..8959094d4 100644
--- a/src/date.c
+++ b/src/date.c
@@ -146,7 +146,9 @@ With -s, or with [MMDDhhmm[[CC]YY][.ss]], set the date and time.\n\
                               warn about questionable usage to standard error\n\
 "), stdout);
       fputs (_("\
-  -f, --file=DATEFILE        like --date; once for each line of DATEFILE\n\
+  -f, --file=DATEFILE        like --date; once for each line of DATEFILE;\n\
+                               If DATEFILE is -, read names from standard input\
+\n\
 "), stdout);
       fputs (_("\
   -I[FMT], --iso-8601[=FMT]  output date/time in ISO 8601 format.\n\
-- 
2.52.0

Reply via email to