src2asciidoc: Skip suppressed arguments.
This commit is contained in:
parent
6e435ad215
commit
8748420b1b
@ -227,6 +227,8 @@ def _format_action_args(action):
|
|||||||
|
|
||||||
def _format_action(action):
|
def _format_action(action):
|
||||||
"""Get an invocation string/help from an argparse action."""
|
"""Get an invocation string/help from an argparse action."""
|
||||||
|
if action.help == argparse.SUPPRESS:
|
||||||
|
return None
|
||||||
if not action.option_strings:
|
if not action.option_strings:
|
||||||
invocation = '*{}*::'.format(_get_action_metavar(action))
|
invocation = '*{}*::'.format(_get_action_metavar(action))
|
||||||
else:
|
else:
|
||||||
@ -396,7 +398,9 @@ def regenerate_manpage(filename):
|
|||||||
if group.description is not None:
|
if group.description is not None:
|
||||||
groupdata.append(group.description)
|
groupdata.append(group.description)
|
||||||
for action in group._group_actions:
|
for action in group._group_actions:
|
||||||
groupdata.append(_format_action(action))
|
action_data = _format_action(action)
|
||||||
|
if action_data is not None:
|
||||||
|
groupdata.append(action_data)
|
||||||
groups.append('\n'.join(groupdata))
|
groups.append('\n'.join(groupdata))
|
||||||
options = '\n'.join(groups)
|
options = '\n'.join(groups)
|
||||||
# epilog
|
# epilog
|
||||||
|
Loading…
Reference in New Issue
Block a user