1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

include default options. #7938

amend ansible-doc to include default options as per feature request #7938
This commit is contained in:
Michael Leer 2014-07-01 18:05:18 +01:00
parent 14cf3c4d2a
commit 37318ca095

View file

@ -113,6 +113,9 @@ def get_man_text(doc):
if 'choices' in opt:
choices = ", ".join(str(i) for i in opt['choices'])
desc = desc + " (Choices: " + choices + ")"
if 'default' in opt:
default = str(opt['default'])
desc = desc + " [Default: " + default + "]"
text.append("%s\n" % textwrap.fill(tty_ify(desc), initial_indent=opt_indent,
subsequent_indent=opt_indent))