Don't display mach category if no commands are registered in it

RESOLVED FIXED in mozilla26

Status

Firefox Build System
Mach Core
RESOLVED FIXED
5 years ago
3 months ago

People

(Reporter: ahal, Assigned: ahal)

Tracking

unspecified
mozilla26

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 786347 [details] [diff] [review]
Patch 1.0 - mach_hide_category

If a category is defined, but no commands have been registered under it, then it shouldn't show up in the help menu.
Attachment #786347 - Flags: review?(gps)

Comment 1

5 years ago
Comment on attachment 786347 [details] [diff] [review]
Patch 1.0 - mach_hide_category

Review of attachment 786347 [details] [diff] [review]:
-----------------------------------------------------------------

::: python/mach/mach/dispatcher.py
@@ +147,5 @@
>  
>          cats = [(k, v[2]) for k, v in r.categories.items()]
>          sorted_cats = sorted(cats, key=itemgetter(1), reverse=True)
>          for category, priority in sorted_cats:
> +            if len(r.commands_by_category[category]) == 0:

if not r.commands_by_category[category]:
Attachment #786347 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/b24fd0f0eb42
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26

Updated

3 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.