Avoid None values in documentation.
This commit is contained in:
parent
3467dd77ac
commit
ebb9e270d3
@ -185,9 +185,14 @@ def _get_command_doc(name, cmd):
|
|||||||
output.append("")
|
output.append("")
|
||||||
for arg, desc in arg_descs.items():
|
for arg, desc in arg_descs.items():
|
||||||
text = ' '.join(desc).splitlines()
|
text = ' '.join(desc).splitlines()
|
||||||
item = "* +{}+: {}".format(arg, text[0])
|
firstline = text[0].replace(', or None', '')
|
||||||
|
item = "* +{}+: {}".format(arg, firstline)
|
||||||
if arg in defaults:
|
if arg in defaults:
|
||||||
item += " (default: +{}+)\n".format(defaults[arg])
|
val = defaults[arg]
|
||||||
|
if val is None:
|
||||||
|
item += " (optional)\n"
|
||||||
|
else:
|
||||||
|
item += " (default: +{}+)\n".format(defaults[arg])
|
||||||
item += '\n'.join(text[1:])
|
item += '\n'.join(text[1:])
|
||||||
output.append(item)
|
output.append(item)
|
||||||
output.append("")
|
output.append("")
|
||||||
|
Loading…
Reference in New Issue
Block a user