@cryptotaxi247 / kubo / commits / 12a6a87b2

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

Matt Bell committed Oct 21, 2014 at 18:27 UTC 12a6a87b2c8a23ebace8034f4345ff65034d52d2
1 file changed +3 -3
commands/cli/parse.go
+3 -3
@@ -9,14 +9,14 @@ import (
9
10 // Parse parses the input commandline string (cmd, flags, and args).
11 // returns the corresponding command Request object.
12 -func Parse(input []string, root *commands.Command) ([]string, map[string]interface{}, []string, error) {
12 +func Parse(input []string, root *commands.Command) (commands.Request, error) {
13 path, input := parsePath(input, root)
14 opts, args, err := parseOptions(input)
15 if err != nil {
16 - return nil, nil, nil, err
16 + return nil, err
17 }
18
19 - return path, opts, args, nil
19 + return commands.NewRequest(path, opts, args, nil), nil
20 }
21
22 // parsePath gets the command path from the command line input