Skip to content

Commit

Permalink
Merge pull request #30 from reeflective/dev
Browse files Browse the repository at this point in the history
Fix recursive filtering
  • Loading branch information
maxlandon authored Sep 7, 2023
2 parents a156cd5 + b6f68d4 commit 367531b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ func (m *Menu) CheckIsAvailable(cmd *cobra.Command) error {
// does not declare as compliant with (added with console.Hide/ShowCommand()).
func (m *Menu) ActiveFiltersFor(cmd *cobra.Command) []string {
if cmd.Annotations == nil {
if cmd.HasParent() {
return m.ActiveFiltersFor(cmd.Parent())
}

return nil
}

Expand All @@ -244,7 +248,7 @@ func (m *Menu) ActiveFiltersFor(cmd *cobra.Command) []string {
}
}

if len(filters) > 0 {
if len(filters) > 0 || !cmd.HasParent() {
return filters
}

Expand Down

0 comments on commit 367531b

Please sign in to comment.