]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: use consistent references to standard files in messages
authorCollin Funk <collin.funk1@gmail.com>
Wed, 6 Aug 2025 01:46:04 +0000 (18:46 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Wed, 6 Aug 2025 01:46:04 +0000 (18:46 -0700)
* cfg.mk (sc_standard_outputs): Add a grep command for source files.
* src/du.c (main): Use standard input instead of stdin, standard output
instead of stdout, and standard error instead of stderr in messages.
* src/nohup.c (main): Likewise.
* src/sort.c (main): Likewise.
* src/split.c (main): Likewise.
* src/stdbuf.c (main): Likewise.
* src/wc.c (main): Likewise.
* tests/du/files0-from.pl (@Tests): Adjust test case to new messages.
* tests/sort/sort-files0-from.pl: Likewise.
* tests/wc/wc-files0-from.pl: Likewise.

cfg.mk
src/du.c
src/nohup.c
src/sort.c
src/split.c
src/stdbuf.c
src/wc.c
tests/du/files0-from.pl
tests/sort/sort-files0-from.pl
tests/wc/wc-files0-from.pl

diff --git a/cfg.mk b/cfg.mk
index eecec2d727a1a1235d79fa0aee96a929412ef317..2115b8441a3a96d8958ec4fc1a73c446283e5e97 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -341,6 +341,8 @@ sc_standard_outputs: $(ALL_MANS)
          && { echo 1>&2 '$@: use "standard ....." in user docs'; exit 1; } || :
        @grep -E '[Ss]tandard (in|out|err)([^op]|$$)' man/*.1 doc/*.texi \
          && { echo 1>&2 '$@: use "standard ..put" in user docs'; exit 1; } || :
+       @grep -E '_\("[^"]*std(in|out|err)' src/*.c \
+         && { echo 1>&2 '$@: use "standard ..put" in messages'; exit 1; } || :
 
 # Option descriptions should not start with a capital letter.
 # One could grep source directly as follows:
index c93d7f71b4bbbef10ff64d9296127d9a8ae7cb6c..e8ad3e93c0d300ea5e7865133e45c6c676a7ef93 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -1070,7 +1070,7 @@ main (int argc, char **argv)
         {
           /* Give a better diagnostic in an unusual case:
              printf - | du --files0-from=- */
-          error (0, 0, _("when reading file names from stdin, "
+          error (0, 0, _("when reading file names from standard input, "
                          "no file name of %s allowed"),
                  quoteaf (file_name));
           skip_file = true;
index 5b590fbb5e1506cc8cb9fec6e812caaec709513f..d062d2cb8859f3970ac9725116df65c67d26cd61 100644 (file)
@@ -191,8 +191,9 @@ main (int argc, char **argv)
       if (!redirecting_stdout)
         error (0, 0,
                _(ignoring_input
-                 ? N_("ignoring input and redirecting stderr to stdout")
-                 : N_("redirecting stderr to stdout")));
+                 ? N_("ignoring input and redirecting standard error "
+                      "to standard output")
+                 : N_("redirecting standard error to standard output")));
 
       if (dup2 (out_fd, STDERR_FILENO) < 0)
         error (exit_internal_failure, errno,
index 7f1b51dd55d38cde3fed8c2ad8ee6019f6b76886..8363d2d1d921e5a9fb0c5d010da5cb4c44fd63bc 100644 (file)
@@ -4760,7 +4760,8 @@ main (int argc, char **argv)
           for (size_t i = 0; i < nfiles; i++)
             {
               if (STREQ (files[i], "-"))
-                error (SORT_FAILURE, 0, _("when reading file names from stdin, "
+                error (SORT_FAILURE, 0, _("when reading file names from "
+                                          "standard input, "
                                           "no file name of %s allowed"),
                        quoteaf (files[i]));
               else if (files[i][0] == '\0')
index 22a83ad5c879502142926ff1cde03e5348154cba..e5f6947f817ee5d94db2877b5e4974af2b9f1754 100644 (file)
@@ -1558,7 +1558,8 @@ main (int argc, char **argv)
 
   if (k_units != 0 && filter_command)
     {
-      error (0, 0, _("--filter does not process a chunk extracted to stdout"));
+      error (0, 0, _("--filter does not process a chunk extracted to "
+                     "standard output"));
       usage (EXIT_FAILURE);
     }
 
index 9fa9d01f410a55d2ea4bee6df978d57b048d2363..b61ddf6a46a0cb87da1fe0278ce9ffe405812192 100644 (file)
@@ -343,7 +343,7 @@ main (int argc, char **argv)
               /* -oL will be by far the most common use of this utility,
                  but one could easily think -iL might have the same affect,
                  so disallow it as it could be confusing.  */
-              error (0, 0, _("line buffering stdin is meaningless"));
+              error (0, 0, _("line buffering standard input is meaningless"));
               usage (EXIT_CANCELED);
             }
 
index 24dc4b3a98171b0709ce24cae46e91131d237294..05e78676e35aa5aec4cd7dc868595ee682b1d66d 100644 (file)
--- a/src/wc.c
+++ b/src/wc.c
@@ -876,7 +876,7 @@ main (int argc, char **argv)
         {
           /* Give a better diagnostic in an unusual case:
              printf - | wc --files0-from=- */
-          error (0, 0, _("when reading file names from stdin, "
+          error (0, 0, _("when reading file names from standard input, "
                          "no file name of %s allowed"),
                  quoteaf (file_name));
           skip_file = true;
index 77057aa46b91db0562daa1c3cc45ce2d5e4b1c54..fe053f64811fef049688b599cd2ded6dc04190c6 100755 (executable)
@@ -42,8 +42,8 @@ my @Tests =
 
    # input file name of '-'
    ['minus-in-stdin', '--files0-from=-', '<', {IN=>{f=>'-'}}, {EXIT=>1},
-    {ERR => "$prog: when reading file names from stdin, no file name of"
-     . " '-' allowed\n"}],
+    {ERR => "$prog: when reading file names from standard input, "
+     . "no file name of '-' allowed\n"}],
 
    # empty input, regular file
    ['empty', '--files0-from=@AUX@', {AUX=>''}],
index eb36e2118c38bef5df9c35f79467258fa3954429..d91924aac731e741e2cfbfc80a4167eabe39e8b1 100755 (executable)
@@ -42,8 +42,8 @@ my @Tests =
 
    # input file name of '-'
    ['minus-in-stdin', '--files0-from=-', '<', {IN=>{f=>'-'}}, {EXIT=>2},
-    {ERR => "$prog: when reading file names from stdin, no file name of"
-     . " '-' allowed\n"}],
+    {ERR => "$prog: when reading file names from standard input, "
+     . "no file name of '-' allowed\n"}],
 
    # empty input, regular file
    ['empty', '--files0-from=@AUX@', {AUX=>''}, {EXIT=>2},
index bf6b6f85b7b50de70df0b9d877238d4216a10b66..5d803083e0bf907b9508e8af98a328cde90c2cec 100755 (executable)
@@ -42,8 +42,8 @@ my @Tests =
 
    # input file name of '-'
    ['minus-in-stdin', '--files0-from=-', '<', {IN=>{f=>'-'}}, {EXIT=>1},
-    {ERR => "$prog: when reading file names from stdin, no file name of"
-     . " '-' allowed\n"}],
+    {ERR => "$prog: when reading file names from standard input, "
+     . "no file name of '-' allowed\n"}],
 
    # empty input, regular file
    ['empty', '--files0-from=@AUX@', {AUX=>''}],