Add tests for command.VisibleFlagCategory

This commit is contained in:
Naveen Gogineni
2022-10-07 11:06:34 -05:00
parent e62a087117
commit 8227be1fe9
3 changed files with 65 additions and 5 deletions

4
app.go
View File

@@ -229,7 +229,9 @@ func (a *App) Setup() {
a.flagCategories = newFlagCategories()
for _, fl := range a.Flags {
if cf, ok := fl.(CategorizableFlag); ok {
a.flagCategories.AddFlag(cf.GetCategory(), cf)
if cf.GetCategory() != "" {
a.flagCategories.AddFlag(cf.GetCategory(), cf)
}
}
}