]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: ls: fix regression in -f description
authorPádraig Brady <P@draigBrady.com>
Mon, 11 Dec 2023 14:20:47 +0000 (14:20 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 11 Dec 2023 14:37:02 +0000 (14:37 +0000)
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
src/ls.c

index 7ad8c0db7cc756f808cf988d7f8949ed02d3f3cf..d445ea228071afeb70bcf62c484da794a3336be1 100644 (file)
@@ -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
index 2631526635b3dae1345251849b9f3abe02237ef8..1cc48aa3a2f58942de3382abf363d78de4a383c6 100644 (file)
--- 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);