Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Oct 7, 2022
1 parent 8227be1 commit 81f9145
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,7 @@ func (c *Command) VisibleCommands() []*Command {
// VisibleFlagCategories returns a slice containing all the visible flag categories with the flags they contain
func (c *Command) VisibleFlagCategories() []VisibleFlagCategory {
if c.flagCategories == nil {
c.flagCategories = newFlagCategories()
for _, fl := range c.Flags {
if cf, ok := fl.(CategorizableFlag); ok {
if cf.GetCategory() != "" {
c.flagCategories.AddFlag(cf.GetCategory(), cf)
}
}
}
c.flagCategories = newFlagCategoriesFromFlags(c.Flags)
}
return c.flagCategories.VisibleCategories()
}
Expand Down

0 comments on commit 81f9145

Please sign in to comment.