diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 2a6aa7f95..39fceef8f 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -1,6 +1,7 @@ package cli import ( + "errors" "fmt" "strings" @@ -30,6 +31,10 @@ func Parse(input []string, roots ...*cmds.Command) (cmds.Request, *cmds.Command, } } + if maxLength == 0 { + return nil, nil, errors.New("Not a valid subcommand") + } + // TODO: figure out how to know when to read given file(s) as an input stream // (instead of filename arg string)