1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-06 02:23:24 +00:00

fs: Add global flag '--color' to control terminal colors

* fs: add TerminalColorMode type
* fs: add new config(flags) for TerminalColorMode
* lib/terminal: use TerminalColorMode to determine how to handle colors
* Add documentation for '--terminal-color-mode'
* tree: remove obsolete --color replaced by global --color

This changes the default behaviour of tree. It now displays colors by
default instead of only displaying them when the flag -C/--color was
active. Old behaviour (no color) can be achieved by setting --color to
'never'.

Fixes: #6604
This commit is contained in:
Kevin Verstaen
2022-12-06 13:07:06 +01:00
committed by GitHub
parent a9bd0c8de6
commit c2dfc3e5b3
9 changed files with 157 additions and 4 deletions

View File

@@ -48,7 +48,6 @@ rclone tree remote:path [flags]
```
-a, --all All files are listed (list . files too)
-C, --color Turn colorization on always
-d, --dirs-only List directories only
--dirsfirst List directories before files (-U disables)
--full-path Print the full path prefix for each file

View File

@@ -823,6 +823,16 @@ quicker than without the `--checksum` flag.
When using this flag, rclone won't update mtimes of remote files if
they are incorrect as it would normally.
### --color WHEN ###
Specifiy when colors (and other ANSI codes) should be added to the output.
`AUTO` (default) only allows ANSI codes when the output is a terminal
`NEVER` never allow ANSI codes
`ALWAYS` always add ANSI codes, regardless of the output format (terminal or file)
### --compare-dest=DIR ###
When using `sync`, `copy` or `move` DIR is checked in addition to the

View File

@@ -27,6 +27,7 @@ These flags are available for every command.
-c, --checksum Skip based on checksum (if available) & size, not mod-time & size
--client-cert string Client SSL certificate (PEM) for mutual TLS auth
--client-key string Client SSL private key (PEM) for mutual TLS auth
--color Define when colors (and other ANSI codes) should be shown AUTO|ALWAYS|NEVER (default AUTO)
--compare-dest stringArray Include additional comma separated server-side paths during comparison
--config string Config file (default "$HOME/.config/rclone/rclone.conf")
--contimeout duration Connect timeout (default 1m0s)