diff options
| author | Collin Funk <collin.funk1@gmail.com> | 2025-08-03 12:33:55 -0700 |
|---|---|---|
| committer | Collin Funk <collin.funk1@gmail.com> | 2025-08-03 12:33:55 -0700 |
| commit | 2ff3c65e940f152a7b56395a5828c052f30dba50 (patch) | |
| tree | 3b9b6d02697f224ec229330438a2766ead23fd1f | |
| parent | readlink: emit errors when POSIXLY_CORRECT is set (diff) | |
| download | coreutils-2ff3c65e940f152a7b56395a5828c052f30dba50.tar.gz coreutils-2ff3c65e940f152a7b56395a5828c052f30dba50.zip | |
readlink: improve documentation for POSIXLY_CORRECT in --help
* 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.
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | doc/coreutils.texi | 6 | ||||
| -rw-r--r-- | src/readlink.c | 7 |
3 files changed, 11 insertions, 6 deletions
@@ -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 diff --git a/doc/coreutils.texi b/doc/coreutils.texi index f268c9249..c5ecf2376 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -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 diff --git a/src/readlink.c b/src/readlink.c index 9e7f2320a..e77818592 100644 --- a/src/readlink.c +++ b/src/readlink.c @@ -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); |
