Add --color=[always|never|auto] argument; fix color when piping (#3013)

* Disable spec colorization when redirecting stdout and add command line flag to re-enable
* Add command line `--color` flag to control output colorization
* Add options to `llnl.util.tty.color` to allow color to be auto/always/never
* Add `Spec.cformat()` function to be used when `format()` should have auto-coloring
This commit is contained in:
paulhopkins
2017-07-31 20:57:47 +01:00
committed by Todd Gamblin
parent f3c70c235c
commit 1c7e5724d9
14 changed files with 105 additions and 45 deletions

View File

@@ -115,7 +115,8 @@ function _spack {
if $list_options
then
compgen -W "-h --help -d --debug -D --pdb -k --insecure -m --mock -p
--profile -v --verbose -s --stacktrace -V --version" -- "$cur"
--profile -v --verbose -s --stacktrace -V --version
--color --color=always --color=auto --color=never" -- "$cur"
else
compgen -W "$(_subcommands)" -- "$cur"
fi