提交 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,
// use the root that matches the longest path (most accurately matches request)
maxLength := 0
for _, r := range roots {
p, i, c := parsePath(input, r)
o, s, err := parseOptions(i)
for _, root2 := range roots {
path2, input2, cmd2 := parsePath(input, root2)
opts2, stringArgs2, err := parseOptions(input2)
if err != nil {
return nil, root, c, p, err
return nil, root, cmd2, path2, err
}
length := len(p)
length := len(path2)
if length > maxLength {
maxLength = length
root = r
path = p
cmd = c
opts = o
stringArgs = s
root = root2
path = path2
cmd = cmd2
opts = opts2
stringArgs = stringArgs2
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论