提交 54812306 作者: Matt Bell 提交者: Juan Batiz-Benet

commands/cli: Use better temp variable names in Parse

上级 f48ce10e
...@@ -20,21 +20,21 @@ func Parse(input []string, roots ...*cmds.Command) (cmds.Request, *cmds.Command, ...@@ -20,21 +20,21 @@ func Parse(input []string, roots ...*cmds.Command) (cmds.Request, *cmds.Command,
// use the root that matches the longest path (most accurately matches request) // use the root that matches the longest path (most accurately matches request)
maxLength := 0 maxLength := 0
for _, r := range roots { for _, root2 := range roots {
p, i, c := parsePath(input, r) path2, input2, cmd2 := parsePath(input, root2)
o, s, err := parseOptions(i) opts2, stringArgs2, err := parseOptions(input2)
if err != nil { if err != nil {
return nil, root, c, p, err return nil, root, cmd2, path2, err
} }
length := len(p) length := len(path2)
if length > maxLength { if length > maxLength {
maxLength = length maxLength = length
root = r root = root2
path = p path = path2
cmd = c cmd = cmd2
opts = o opts = opts2
stringArgs = s stringArgs = stringArgs2
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论