Ignore argument groups in the web UI that are empty except --help

This commit is contained in:
Florian Festi 2018-10-27 13:05:02 +02:00
parent b9f652ee71
commit b1eced8259
1 changed files with 2 additions and 0 deletions

View File

@ -182,6 +182,8 @@ class BServer:
for group in box.argparser._action_groups[3:] + box.argparser._action_groups[:3]:
if not group._group_actions:
continue
if len(group._group_actions) == 1 and isinstance(group._group_actions[0], argparse._HelpAction):
continue
prefix = getattr(group, "prefix", None)
result.append('''<h3 id="h-%s" class="open" onclick="showHide(%s)">%s</h3>\n<table id="%s">\n''' % (groupid, groupid, group.title, groupid))
for a in group._group_actions: