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 221f40a29d
commit 59d1700ccc
No known key found for this signature in database
GPG Key ID: AA98A2FCFE70D0C9

@ -50,9 +50,11 @@ func newBumpCmd(actionConfig *action.Configuration, out io.Writer) *cobra.Comman
if len(args) == 2 {
o.bumpType = args[0]
o.chart = args[1]
} else {
} else if len(args) == 1 {
o.bumpType = ""
o.chart = args[0]
} else {
return fmt.Errorf("invalid arguments: %v", args)
}
return o.run(actionConfig, out)

@ -47,6 +47,10 @@ func TestBump(t *testing.T) {
}
tests := []cmdTestCase{{
name: "no args",
cmd: "bump",
wantError: true,
}, {
name: "default",
cmd: "bump " + tempChartDir,
golden: "output/bump-default.txt",

Loading…
Cancel
Save