Skip to content

Commit 1c05463

Browse files
Jeff Knurekdatabus23
authored andcommitted
FLAG: add --no-color to disable color in the output, fixes #17
1 parent 38b85a3 commit 1c05463

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"os"
66

7+
"github.com/mgutz/ansi"
78
"github.com/spf13/cobra"
89
"k8s.io/helm/pkg/helm"
910

@@ -53,6 +54,10 @@ func main() {
5354
diff.suppressedKinds = append(diff.suppressedKinds, "Secret")
5455
}
5556

57+
if nc, _ := cmd.Flags().GetBool("no-color"); nc {
58+
ansi.DisableColors(true)
59+
}
60+
5661
diff.release = args[0]
5762
diff.chart = args[1]
5863
if diff.client == nil {
@@ -65,6 +70,7 @@ func main() {
6570
f := cmd.Flags()
6671
f.BoolP("version", "v", false, "show version")
6772
f.BoolP("suppress-secrets", "q", false, "suppress secrets in the output")
73+
f.Bool("no-color", false, "remove colors from the output")
6874
f.VarP(&diff.valueFiles, "values", "f", "specify values in a YAML file (can specify multiple)")
6975
f.StringArrayVar(&diff.values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)")
7076
f.BoolVar(&diff.reuseValues, "reuse-values", false, "reuse the last release's values and merge in any new values")

0 commit comments

Comments
 (0)