diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 757f83e60..a58298f17 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -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 } diff --git a/commands/command.go b/commands/command.go index fb34845da..64b63903b 100644 --- a/commands/command.go +++ b/commands/command.go @@ -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] }