commands/cli: Made Parse return a Request (again)

This commit is contained in:
Matt Bell 2014-10-21 18:27:05 -07:00
parent d464e3d143
commit 12a6a87b2c

View File

@ -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