summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJason Kim <git@jasonk.me>2020-04-19 01:40:16 -0700
committerPádraig Brady <P@draigBrady.com>2020-04-27 13:48:32 +0100
commit9c8a385aa4c342a2b1af5f5a0604afb249a1cf66 (patch)
tree1b85c732bb1d0758bfaea0adfe01b9636f9f21e2 /doc
parentf38bd362d9a2c97f11188b20258447d0540c995d (diff)
downloadcoreutils-9c8a385aa4c342a2b1af5f5a0604afb249a1cf66.tar.gz
ls: allow --classify to be ignored for non tty output
Have the `ls` `--classify` option take an optional argument for when to classify ("always", "auto", "never"), just like the optional argument for `--color`. When the optional argument is not specified, default to "always" for backwards compatibility. * src/ls.c (usage): Update help text. (decode_switches): Support an optional argument for --classify. * tests/ls/classify.sh: Add a new test. * tests/local.mk: Reference the new test. * NEWS: Mention the new feature.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi17
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 24e424c54..0e1dc48bd 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -8004,7 +8004,7 @@ and on a @code{dirent.d_type}-capable file system, @command{ls}
will perform only one @code{stat} call per command line argument.
@item -F
-@itemx --classify
+@itemx --classify [=@var{when}]
@itemx --indicator-style=classify
@opindex -F
@opindex --classify
@@ -8016,6 +8016,21 @@ for regular files that are executable, append @samp{*}. The file type
indicators are @samp{/} for directories, @samp{@@} for symbolic links,
@samp{|} for FIFOs, @samp{=} for sockets, @samp{>} for doors,
and nothing for regular files.
+@var{when} may be omitted, or one of:
+@itemize @bullet
+@item none
+@vindex none @r{classify option}
+- Do not classify. This is the default.
+@item auto
+@vindex auto @r{classify option}
+@cindex terminal, using classify iff
+- Only classify if standard output is a terminal.
+@item always
+@vindex always @r{classify option}
+- Always classify.
+@end itemize
+Specifying @option{--classify} and no @var{when} is equivalent to
+@option{--classify=always}.
@c The following sentence is the same as the one for -d.
Do not follow symbolic links listed on the
command line unless the @option{--dereference-command-line} (@option{-H}),