commands/cli: Use better temp variable names in Parse
Matt Bell committed
Nov 11, 2014 at 16:43 UTC
5481230679b9ad0cb1571259dcf51415aaec1b61
1 file changed
+10
-10
commands/cli/parse.go
+10
-10
@@ -20,21 +20,21 @@ func Parse(input []string, roots ...*cmds.Command) (cmds.Request, *cmds.Command,
20
21
// use the root that matches the longest path (most accurately matches request)
22
maxLength := 0
23
- for _, r := range roots {
24
- p, i, c := parsePath(input, r)
25
- o, s, err := parseOptions(i)
23
+ for _, root2 := range roots {
24
+ path2, input2, cmd2 := parsePath(input, root2)
25
+ opts2, stringArgs2, err := parseOptions(input2)
26
if err != nil {
27
- return nil, root, c, p, err
27
+ return nil, root, cmd2, path2, err
28
}
29
30
- length := len(p)
30
+ length := len(path2)
31
if length > maxLength {
32
maxLength = length
33
- root = r
34
- path = p
35
- cmd = c
36
- opts = o
37
- stringArgs = s
33
+ root = root2
34
+ path = path2
35
+ cmd = cmd2
36
+ opts = opts2
37
+ stringArgs = stringArgs2
38
}
39
}
40