MCPcopy
hub / github.com/docker/compose / useAnsi

Function useAnsi

cmd/formatter/colors.go:75–83  ·  view source on GitHub ↗
(streams command.Streams, ansi string)

Source from the content-addressed store, hash-verified

73}
74
75func useAnsi(streams command.Streams, ansi string) bool {
76 switch ansi {
77 case Always:
78 return true
79 case Auto:
80 return streams.Out().IsTerminal()
81 }
82 return false
83}
84
85// colorFunc use ANSI codes to render colored text on console
86type colorFunc func(s string) string

Callers 1

SetANSIModeFunction · 0.85

Calls 1

OutMethod · 0.45

Tested by

no test coverage detected