diff --git a/app.go b/app.go index 6e6f6d0d63..af072e7699 100644 --- a/app.go +++ b/app.go @@ -229,8 +229,6 @@ func (a *App) Setup() { a.separator.disabled = true } - var newCommands []*Command - for _, c := range a.Commands { cname := c.Name if c.HelpName != "" { @@ -239,9 +237,7 @@ func (a *App) Setup() { c.separator = a.separator c.HelpName = fmt.Sprintf("%s %s", a.HelpName, cname) c.flagCategories = newFlagCategoriesFromFlags(c.Flags) - newCommands = append(newCommands, c) } - a.Commands = newCommands if a.Command(helpCommand.Name) == nil && !a.HideHelp { if !a.HideHelpCommand { diff --git a/command.go b/command.go index c20a571ee7..472c1ff446 100644 --- a/command.go +++ b/command.go @@ -132,15 +132,12 @@ func (c *Command) setup(ctx *Context) { } sort.Sort(c.categories.(*commandCategories)) - var newCmds []*Command for _, scmd := range c.Subcommands { if scmd.HelpName == "" { scmd.HelpName = fmt.Sprintf("%s %s", c.HelpName, scmd.Name) } scmd.separator = c.separator - newCmds = append(newCmds, scmd) } - c.Subcommands = newCmds if c.BashComplete == nil { c.BashComplete = DefaultCompleteWithFlags(c)