fixup! throw correct error if no args provided

Signed-off-by: Jan Braje <12571346+janluak@users.noreply.github.com>
pull/32402/head
Jan Braje 3 months ago
parent 3e3578aefa
commit 8690b7bc23
No known key found for this signature in database
GPG Key ID: AA98A2FCFE70D0C9

@ -47,13 +47,14 @@ func newBumpCmd(actionConfig *action.Configuration, out io.Writer) *cobra.Comman
Args: require.MaximumNArgs(2),
ValidArgsFunction: noMoreArgsCompFunc,
RunE: func(_ *cobra.Command, args []string) error {
if len(args) == 2 {
switch {
case len(args) == 2:
o.bumpType = args[0]
o.chart = args[1]
} else if len(args) == 1 {
case len(args) == 1:
o.bumpType = ""
o.chart = args[0]
} else {
default:
return fmt.Errorf("invalid arguments: %v", args)
}

Loading…
Cancel
Save