configureColorOutput configures the color output based on the ColorMode setting
(settings *cli.EnvSettings)
| 135 | |
| 136 | // configureColorOutput configures the color output based on the ColorMode setting |
| 137 | func configureColorOutput(settings *cli.EnvSettings) { |
| 138 | switch settings.ColorMode { |
| 139 | case "never": |
| 140 | color.NoColor = true |
| 141 | case "always": |
| 142 | color.NoColor = false |
| 143 | case "auto": |
| 144 | // Let fatih/color handle automatic detection |
| 145 | // It will check if output is a terminal and NO_COLOR env var |
| 146 | // We don't need to do anything here |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | func newRootCmdWithConfig(actionConfig *action.Configuration, out io.Writer, args []string, logSetup func(bool)) (*cobra.Command, error) { |
| 151 | cmd := &cobra.Command{ |
no outgoing calls
no test coverage detected
searching dependent graphs…