mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 05:47:51 +08:00
Sub -> Subcommand
This commit is contained in:
parent
84fa7bc46d
commit
92528ba764
@ -33,7 +33,7 @@ func parsePath(input []string, root *commands.Command) ([]string, []string, erro
|
||||
break
|
||||
}
|
||||
|
||||
cmd := cmd.Sub(blob)
|
||||
cmd := cmd.Subcommand(blob)
|
||||
if cmd == nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ func (c *Command) Resolve(path []string) ([]*Command, error) {
|
||||
|
||||
cmd := c
|
||||
for i, name := range path {
|
||||
cmd = cmd.Sub(name)
|
||||
cmd = cmd.Subcommand(name)
|
||||
|
||||
if cmd == nil {
|
||||
pathS := strings.Join(path[0:i], "/")
|
||||
@ -128,8 +128,8 @@ func (c *Command) GetOptions(path []string) (map[string]Option, error) {
|
||||
return optionsMap, nil
|
||||
}
|
||||
|
||||
// Sub returns the subcommand with the given id
|
||||
func (c *Command) Sub(id string) *Command {
|
||||
// Subcommand returns the subcommand with the given id
|
||||
func (c *Command) Subcommand(id string) *Command {
|
||||
return c.subcommands[id]
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user