]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
readlink: improve documentation for POSIXLY_CORRECT in --help
authorCollin Funk <collin.funk1@gmail.com>
Sun, 3 Aug 2025 19:33:55 +0000 (12:33 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 3 Aug 2025 19:33:55 +0000 (12:33 -0700)
* NEWS: Improve wording to not imply POSIXLY_CORRECT=1 readlink -q will
be verbose.
* src/readlink.c (usage): Mention the affect of POSIXLY_CORRECT on
-s (--silent), -q (--quiet), and -v (--verbose) in the help message.
(main): Remove spurious newline added by previous commit.
* doc/coreutils.texi (readlink invocation): Mention that -s (--silent)
and -q (--quiet) are not the default when POSIXLY_CORRECT is set.

NEWS
doc/coreutils.texi
src/readlink.c

diff --git a/NEWS b/NEWS
index 9839aeb87b6a5f5c1468fae527a7a062fcc62b0b..a9132bbcfd04c58fe463dec6aabce3ba7ada6604 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,8 +7,8 @@ GNU coreutils NEWS                                    -*- outline -*-
   'factor' is now much faster at identifying large prime numbers,
   and significantly faster on composite numbers greater than 2^128.
 
-  readlink will behave as if the -v option is used if the
-  POSIXLY_CORRECT environment variable is defined.
+  readlink now defaults to being verbose if the POSIXLY_CORRECT
+  environment variable is set.
 
 ** Bug fixes
 
index f268c9249b5fb4cfcf7cbbf950171eede54c962f..c5ecf23769e1b554caaac37958c7e8dd234b5465 100644 (file)
@@ -11462,7 +11462,11 @@ Print a warning if specified along with multiple @var{file}s.
 @opindex -q
 @opindex --silent
 @opindex --quiet
-Suppress most error messages.  On by default.
+Suppress most error messages.
+
+@vindex POSIXLY_CORRECT
+This option is on by default if the @env{POSIXLY_CORRECT} environment
+variable is not set.
 
 @item -v
 @itemx --verbose
index 9e7f2320a57da1cfb73dcaea0a27044fa00d617c..e778185926e04e7a1d71e3f261e63848026c15e5 100644 (file)
@@ -78,8 +78,10 @@ usage (int status)
                                 without requirements on components existence\n\
   -n, --no-newline              do not output the trailing delimiter\n\
   -q, --quiet\n\
-  -s, --silent                  suppress most error messages (on by default)\n\
-  -v, --verbose                 report error messages\n\
+  -s, --silent                  suppress most error messages (on by default\n\
+                                if POSIXLY_CORRECT is not set)\n\
+  -v, --verbose                 report error messages (on by default if\n\
+                                POSIXLY_CORRECT is set)\n\
   -z, --zero                    end each output line with NUL, not newline\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
@@ -163,7 +165,6 @@ main (int argc, char **argv)
       char *value = (can_mode != -1
                      ? canonicalize_filename_mode (fname, can_mode)
                      : areadlink_with_size (fname, 63));
-
       if (value)
         {
           fputs (value, stdout);