Don't display empty values as defaults

This commit is contained in:
Patrick Elmer 2023-08-20 10:18:19 +09:00
parent fb6ad1f08c
commit b2fd46cd21

View File

@ -155,7 +155,10 @@ def make_lines(config):
if 'docstring' in values:
right_side += truncate_docstring(values['docstring'])
if 'default' in values:
if values['type'] != bool:
if values['type'] not in (bool, type(None)):
if hasattr(values['default'], '__len__') and not len(values['default']):
...
else:
right_side += f" (default: {values['default']})"
left_side = f"--{left_side}"
if 'short_option' in values: