MCPcopy Create free account
hub / github.com/auth0/auth0-cli / shouldUseColors

Function shouldUseColors

internal/ansi/ansi.go:114–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112}
113
114func shouldUseColors() bool {
115 useColors := ForceColors || iostream.IsOutputTerminal()
116
117 if EnvironmentOverrideColors {
118 force, ok := os.LookupEnv("CLICOLOR_FORCE")
119
120 switch {
121 case ok && force != "0":
122 useColors = true
123 case ok && force == "0":
124 useColors = false
125 case os.Getenv("CLICOLOR") == "0":
126 useColors = false
127 }
128 }
129
130 return useColors && !DisableColors
131}

Callers 3

TestShouldUseColorsFunction · 0.85
ColorFunction · 0.85
ColorizeJSONFunction · 0.85

Calls 1

IsOutputTerminalFunction · 0.92

Tested by 1

TestShouldUseColorsFunction · 0.68