tlog: respect NO_COLOR
Fixes https://github.com/rfjakob/gocryptfs/issues/617
This commit is contained in:
parent
bd1ecf5379
commit
a1f01419e2
@ -673,6 +673,13 @@ the `-nofail` option for details).
|
|||||||
|
|
||||||
/tmp/cipher /tmp/plain fuse./usr/local/bin/gocryptfs nofail,allow_other,passfile=/tmp/password 0 0
|
/tmp/cipher /tmp/plain fuse./usr/local/bin/gocryptfs nofail,allow_other,passfile=/tmp/password 0 0
|
||||||
|
|
||||||
|
ENVIRONMENT VARIABLES
|
||||||
|
=====================
|
||||||
|
|
||||||
|
### NO_COLOR
|
||||||
|
|
||||||
|
If `NO_COLOR` is set (regardless of value), colored output is disabled (see https://no-color.org/).
|
||||||
|
|
||||||
EXIT CODES
|
EXIT CODES
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
@ -106,7 +106,9 @@ var Warn *toggledLogger
|
|||||||
var Fatal *toggledLogger
|
var Fatal *toggledLogger
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if term.IsTerminal(int(os.Stdout.Fd())) {
|
// Enable color output if we are connected to a terminal and NO_COLOR is
|
||||||
|
// unset ( https://no-color.org/ ).
|
||||||
|
if _, nocolor := os.LookupEnv("NO_COLOR"); !nocolor && term.IsTerminal(int(os.Stdout.Fd())) {
|
||||||
ColorReset = "\033[0m"
|
ColorReset = "\033[0m"
|
||||||
ColorGrey = "\033[2m"
|
ColorGrey = "\033[2m"
|
||||||
ColorRed = "\033[31m"
|
ColorRed = "\033[31m"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user