From 4de72b7d9f533569f8b636aa9cf8a05552b14ab1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Mon, 11 Dec 2023 14:20:47 +0000 Subject: [PATCH] doc: ls: fix regression in -f description The description of -f regressed in coreutils 9.0 * doc/coreutils.texi (ls invocation): Detail which options are enabled/disabled with -f. * src/ls.c (usage): Likewise. (decode_switches): Update comments. Fixes https://bugs.gnu.org/67765 --- doc/coreutils.texi | 8 ++++---- src/ls.c | 16 +++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 7ad8c0db7c..d445ea2280 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8135,10 +8135,10 @@ sort according to the ctime. @xref{File timestamps}. @cindex unsorted directory listing @cindex directory order, listing by Produce an unsorted directory listing. -This is equivalent to the combination of @option{--all} (@option{-a}), -@option{--sort=none} (@option{-U}), @option{-1}, -@option{--color=none}, and @option{--hyperlink=none}, -while also disabling any previous use of @option{--size} (@option{-s}). +This is like @option{--sort=none} (@option{-U}), +but also enable @option{--all} (@option{-a}), +while also disabling any previous use of @option{-l}, @option{--color} +@option{--size}, or @option{--hyperlink}. @item -r @itemx --reverse diff --git a/src/ls.c b/src/ls.c index 2631526635..1cc48aa3a2 100644 --- a/src/ls.c +++ b/src/ls.c @@ -1950,15 +1950,13 @@ decode_switches (int argc, char **argv) break; case 'f': - /* Same as -a -U -1 --color=none --hyperlink=none, - while disabling -s. */ - ignore_mode = IGNORE_MINIMAL; - sort_opt = sort_none; + ignore_mode = IGNORE_MINIMAL; /* enable -a */ + sort_opt = sort_none; /* enable -U */ if (format_opt == long_format) - format_opt = -1; - print_with_color = false; - print_hyperlink = false; - print_block_size = false; + format_opt = -1; /* disable -l */ + print_with_color = false; /* disable --color */ + print_hyperlink = false; /* disable --hyperlink */ + print_block_size = false; /* disable -s */ break; case FILE_TYPE_INDICATOR_OPTION: /* --file-type */ @@ -5470,7 +5468,7 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\ -D, --dired generate output designed for Emacs' dired mode\n\ "), stdout); fputs (_("\ - -f list all entries in directory order\n\ + -f do not sort, enable -aU, disable -ls --color\n\ -F, --classify[=WHEN] append indicator (one of */=>@|) to entries WHEN\n\ --file-type likewise, except do not append '*'\n\ "), stdout); -- 2.47.2