diff options
author | Brian Coca <brian.coca+git@gmail.com> | 2016-08-12 15:39:48 -0400 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2016-08-15 11:00:29 -0400 |
commit | 64a8d24b723b956238b71b5ec0b75aa7241bb4b9 (patch) | |
tree | 592133fd356f32d946da2ddae9aec1345f4c9746 | |
parent | b3c686f4c547480af521f4ec4d0b41a890aad394 (diff) | |
download | ansible-64a8d24b723b956238b71b5ec0b75aa7241bb4b9.tar.gz |
slightly better presentation docs
- description items are now separated
- choices/defaults start at their own line
-rw-r--r-- | lib/ansible/cli/doc.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 1f989646dc..d3e57e2a36 100644 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -275,17 +275,16 @@ class DocCLI(CLI): text.append("%s %s" % (opt_leadin, o)) if isinstance(opt['description'], list): - desc = " ".join(opt['description']) + for entry in opt['description']: + text.append(textwrap.fill(CLI.tty_ify(entry), limit, initial_indent=opt_indent, subsequent_indent=opt_indent)) else: - desc = opt['description'] + text.append(textwrap.fill(CLI.tty_ify(opt['description']), limit, initial_indent=opt_indent, subsequent_indent=opt_indent)) if 'choices' in opt: - choices = ", ".join(str(i) for i in opt['choices']) - desc = desc + " (Choices: " + choices + ")" + choices = "(Choices: " + ", ".join(str(i) for i in opt['choices']) + ")" if 'default' in opt or not required: - default = str(opt.get('default', '(null)')) - desc = desc + " [Default: " + default + "]" - text.append("%s\n" % textwrap.fill(CLI.tty_ify(desc), limit, initial_indent=opt_indent, subsequent_indent=opt_indent)) + default = "[Default: " + str(opt.get('default', '(null)')) + "]" + text.append(textwrap.fill(CLI.tty_ify(choices + default), limit, initial_indent=opt_indent, subsequent_indent=opt_indent)) if 'notes' in doc and doc['notes'] and len(doc['notes']) > 0: notes = " ".join(doc['notes']) |