mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 10:57:42 +08:00
commands/cli: Made Parse return a Request (again)
This commit is contained in:
parent
d464e3d143
commit
12a6a87b2c
@ -9,14 +9,14 @@ import (
|
||||
|
||||
// Parse parses the input commandline string (cmd, flags, and args).
|
||||
// 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)
|
||||
opts, args, err := parseOptions(input)
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user