Bug 902002 - Don't display mach categories in help if no commands exist under them, r=gps, DONTBUILD, a=NPOTB

This commit is contained in:
Andrew Halberstadt 2013-08-07 15:17:08 -04:00
parent a49a17302a
commit d8d2af0f2f

View File

@ -148,6 +148,9 @@ class CommandAction(argparse.Action):
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 not r.commands_by_category[category]:
continue
title, description, _priority = r.categories[category]
group = parser.add_argument_group(title, description)