(streams command.Streams, ansi string)
| 73 | } |
| 74 | |
| 75 | func 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 |
| 86 | type colorFunc func(s string) string |