Make "BoolFlag" booleans not require =true

This commit is contained in:
Eric Paris
2016-01-08 11:42:06 -05:00
parent 46945ab50f
commit aad4b4477d
7 changed files with 18 additions and 13 deletions

View File

@@ -82,7 +82,8 @@ func NewCmdConfigView(out io.Writer, ConfigAccess ConfigAccess) *cobra.Command {
cmd.Flags().Set("output", defaultOutputFormat)
options.Merge.Default(true)
cmd.Flags().Var(&options.Merge, "merge", "merge together the full hierarchy of kubeconfig files")
f := cmd.Flags().VarPF(&options.Merge, "merge", "", "merge together the full hierarchy of kubeconfig files")
f.NoOptDefVal = "true"
cmd.Flags().BoolVar(&options.RawByteData, "raw", false, "display raw byte data")
cmd.Flags().BoolVar(&options.Flatten, "flatten", false, "flatten the resulting kubeconfig file into self contained output (useful for creating portable kubeconfig files)")
cmd.Flags().BoolVar(&options.Minify, "minify", false, "remove all information not used by current-context from the output")