diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 5f0b2d795..08df7955b 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -9,14 +9,14 @@ import ( // Parse parses the input commandline string (cmd, flags, and args). // returns the corresponding command Request object. -func Parse(input []string, root *commands.Command) ([]string, map[string]interface{}, []string, error) { +func Parse(input []string, root *commands.Command) (commands.Request, error) { path, input := parsePath(input, root) opts, args, err := parseOptions(input) if err != nil { - return nil, nil, nil, err + return nil, err } - return path, opts, args, nil + return commands.NewRequest(path, opts, args, nil), nil } // parsePath gets the command path from the command line input