SetANSIMode configure formatter for colored output on ANSI-compliant console
(streams command.Streams, ansi string)
| 64 | |
| 65 | // SetANSIMode configure formatter for colored output on ANSI-compliant console |
| 66 | func SetANSIMode(streams command.Streams, ansi string) { |
| 67 | if !useAnsi(streams, ansi) { |
| 68 | nextColor = func() colorFunc { |
| 69 | return monochrome |
| 70 | } |
| 71 | disableAnsi = true |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func useAnsi(streams command.Streams, ansi string) bool { |
| 76 | switch ansi { |
no test coverage detected