Rename --keep-metadata flag to --no-override

Signed-off-by: Filip Krakowski <krakowski@hhu.de>
pull/11273/head
Filip Krakowski 3 years ago
parent fcf7c14039
commit 6cd5ae5318
No known key found for this signature in database
GPG Key ID: 9C1E31CEA7A605B8

@ -52,10 +52,10 @@ will be overwritten, but other files will be left alone.
` `
type createOptions struct { type createOptions struct {
starter string // --starter starter string // --starter
name string name string
starterDir string starterDir string
keepMetadata bool noOverride bool
} }
func newCreateCmd(out io.Writer) *cobra.Command { func newCreateCmd(out io.Writer) *cobra.Command {
@ -76,7 +76,7 @@ func newCreateCmd(out io.Writer) *cobra.Command {
return nil, cobra.ShellCompDirectiveNoFileComp return nil, cobra.ShellCompDirectiveNoFileComp
}, },
PreRunE: func(cmd *cobra.Command, args []string) error { PreRunE: func(cmd *cobra.Command, args []string) error {
if len(o.starter) == 0 && o.keepMetadata { if len(o.starter) == 0 && o.noOverride {
return errors.New("the -k/--keep-metadata flag can only be specified when using a starter") return errors.New("the -k/--keep-metadata flag can only be specified when using a starter")
} }
@ -90,7 +90,7 @@ func newCreateCmd(out io.Writer) *cobra.Command {
} }
cmd.Flags().StringVarP(&o.starter, "starter", "p", "", "the name or absolute path to Helm starter scaffold") cmd.Flags().StringVarP(&o.starter, "starter", "p", "", "the name or absolute path to Helm starter scaffold")
cmd.Flags().BoolVarP(&o.keepMetadata, "keep-metadata", "k", false, "if specified, does not override the starter's Chart.yaml") cmd.Flags().BoolVarP(&o.noOverride, "no-override", "n", false, "if specified, does not override the starter's Chart.yaml")
return cmd return cmd
} }
@ -107,7 +107,7 @@ func (o *createOptions) run(out io.Writer) error {
APIVersion: chart.APIVersionV2, APIVersion: chart.APIVersionV2,
} }
if o.keepMetadata { if o.noOverride {
cfile = nil cfile = nil
} }

Loading…
Cancel
Save