Sub -> Subcommand

This commit is contained in:
Juan Batiz-Benet 2014-10-20 07:55:23 -07:00
parent 84fa7bc46d
commit 92528ba764
2 changed files with 4 additions and 4 deletions

View File

@ -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
}

View File

@ -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]
}