提交 12a6a87b 作者: Matt Bell

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

上级 d464e3d1
...@@ -9,14 +9,14 @@ import ( ...@@ -9,14 +9,14 @@ import (
// Parse parses the input commandline string (cmd, flags, and args). // Parse parses the input commandline string (cmd, flags, and args).
// returns the corresponding command Request object. // 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) path, input := parsePath(input, root)
opts, args, err := parseOptions(input) opts, args, err := parseOptions(input)
if err != nil { 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 // parsePath gets the command path from the command line input
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论