diff --git a/cmd/cloud.go b/cmd/cloud.go index 00c1ec0fa1b1..b18000ddcadc 100644 --- a/cmd/cloud.go +++ b/cmd/cloud.go @@ -398,8 +398,8 @@ func exactCloudArgs() cobra.PositionalArgs { return fmt.Errorf(baseErrMsg + "; " + "received no arguments") } - hasSubcommand := len(args) >= 1 && (args[0] == "run" || args[0] == "login") - if !hasSubcommand { + hasSubcommand := args[0] == "run" || args[0] == "login" + if len(args) > 1 && !hasSubcommand { return fmt.Errorf( baseErrMsg+"; "+"received %d arguments %q, and none of them is a subcommand", len(args), strings.Join(args, " "),