Skip to content

Commit

Permalink
Remove un-needed func
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Sep 21, 2022
1 parent 4c96515 commit aecd7c1
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,31 +312,6 @@ func (c *Command) VisibleFlags() []Flag {
return visibleFlags(c.Flags)
}

// VisibleCategories returns a slice of categories and commands that are
// Hidden=false
func (c *Command) VisibleCategories() []CommandCategory {
ret := []CommandCategory{}
if c.categories == nil {
c.categories = newCommandCategories()
for _, command := range c.Subcommands {
c.categories.AddCommand(command.Category, command)
}
sort.Sort(c.categories.(*commandCategories))
}
for _, category := range c.categories.Categories() {
if visible := func() CommandCategory {
if len(category.VisibleCommands()) > 0 {
return category
}
return nil
}(); visible != nil {
ret = append(ret, visible)
}
}

return ret
}

// VisibleCommands returns a slice of the Commands with Hidden=false
func (c *Command) VisibleCommands() []*Command {
var ret []*Command
Expand Down

0 comments on commit aecd7c1

Please sign in to comment.