Skip to content

Commit

Permalink
Added error for no-parameter node start/stop commands
Browse files Browse the repository at this point in the history
This closes #1.
  • Loading branch information
rajch committed Dec 3, 2021
1 parent 3f972c8 commit 0e39f9b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/pkg/cmd/node/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ func nodeStartCommand(c *cobra.Command, args []string) error {
return err
}

if len(args) == 0 {
return cli.WrapErrorMessage(
1,
"at least one node name expected",
)
}

if len(args) == 1 {
return clustercmd.StartNode(cluster, args[0])
}
Expand All @@ -235,6 +242,13 @@ func nodeStopCommand(c *cobra.Command, args []string) error {
return err
}

if len(args) == 0 {
return cli.WrapErrorMessage(
1,
"at least one node name expected",
)
}

if len(args) == 1 {
return clustercmd.StopNode(cluster, args[0])
}
Expand Down

0 comments on commit 0e39f9b

Please sign in to comment.