Преглед изворни кода

docs: description of `--color` in README, manpage, and completions

hehelego пре 2 година
родитељ
комит
cf45b3e4b0
5 измењених фајлова са 13 додато и 6 уклоњено
  1. 1 1
      README.md
  2. 1 1
      completions/bash/eza
  3. 1 0
      completions/fish/eza.fish
  4. 1 1
      completions/zsh/_eza
  5. 9 3
      man/eza.1.md

+ 1 - 1
README.md

@@ -334,7 +334,7 @@ These options are available when running with `--long` (`-l`):
 
 Some of the options accept parameters:
 
-- Valid **--color** options are **always**, **automatic**, and **never**.
+- Valid **--color** options are **always**, **automatic** (or **auto** for short), and **never**.
 - Valid sort fields are **accessed**, **changed**, **created**, **extension**, **Extension**, **inode**, **modified**, **name**, **Name**, **size**, **type**, and **none**. Fields starting with a capital letter sort uppercase before lowercase. The modified field has the aliases **date**, **time**, and **newest**, while its reverse has the aliases **age** and **oldest**.
 - Valid time fields are **modified**, **changed**, **accessed**, and **created**.
 - Valid time styles are **default**, **iso**, **long-iso**, **full-iso**, and **relative**.

+ 1 - 1
completions/bash/eza

@@ -9,7 +9,7 @@ _eza() {
             ;;
 
         --colour)
-            mapfile -t COMPREPLY < <(compgen -W 'always auto never' -- "$cur")
+            mapfile -t COMPREPLY < <(compgen -W 'always automatic auto never' -- "$cur")
             return
             ;;
 

+ 1 - 0
completions/fish/eza.fish

@@ -14,6 +14,7 @@ complete -c eza -l color \
     -l colour -d "When to use terminal colours" -x -a "
     always\t'Always use colour'
     auto\t'Use colour if standard output is a terminal'
+    automatic\t'Use colour if standard output is a terminal'
     never\t'Never use colour'
 "
 complete -c eza -l color-scale \

+ 1 - 1
completions/zsh/_eza

@@ -19,7 +19,7 @@ __eza() {
         {-R,--recurse}"[Recurse into directories]" \
         {-T,--tree}"[Recurse into directories as a tree]" \
         {-F,--classify}"[Display type indicator by file names]" \
-        --colo{,u}r="[When to use terminal colours]:(when):(always auto never)" \
+        --colo{,u}r="[When to use terminal colours]:(when):(always auto automatic never)" \
         --colo{,u}r-scale"[Highlight levels of file sizes distinctly]" \
         --icons"[Display icons]" \
         --no-icons"[Hide icons]" \

+ 9 - 3
man/eza.1.md

@@ -62,9 +62,15 @@ DISPLAY OPTIONS
 `-x`, `--across`
 : Sort the grid across, rather than downwards.
 
-`--color`, `--colour=WHEN`
-: When to use terminal colours.
-Valid settings are ‘`always`’, ‘`automatic`’, and ‘`never`’.
+`--color=WHEN`, `--colour=WHEN`
+: When to use terminal colours (using ANSI escape code to colorize the output).
+
+Valid settings are ‘`always`’, ‘`automatic`’ (or ‘`auto`’ for short), and ‘`never`’.
+The default value is ‘`automatic`’.
+
+The default behavior (‘`automatic`’ or ‘`auto`’) is to colorize the output only when the standard output is connected to a real terminal. If the output of `eza` is redirected to a file or piped into another program, terminal colors will not be used. Setting this option to ‘`always`’ causes `eza` to always output terminal color, while ‘`never`’ disables the use of terminal color.
+
+Manually setting this option overrides `NO_COLOR` environment.
 
 `--color-scale`, `--colour-scale`
 : Colour file sizes on a scale.