summaryrefslogtreecommitdiff
path: root/bin/ansible-doc
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2015-02-12 23:20:43 -0500
committerBrian Coca <brian.coca+git@gmail.com>2015-02-19 13:18:05 -0500
commit1e818f9c509bc8c6376a1f74f6329ab34a17aaf0 (patch)
tree4a5c0a80e3eb080f0a9ba8c64b88dbf6963541df /bin/ansible-doc
parent8be8a7e2f51e7dd10b44d5f98a15fa712331bbb7 (diff)
downloadansible-1e818f9c509bc8c6376a1f74f6329ab34a17aaf0.tar.gz
ansible-doc now shows return value docs
Diffstat (limited to 'bin/ansible-doc')
-rwxr-xr-xbin/ansible-doc7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/ansible-doc b/bin/ansible-doc
index 8bab0e76cd..3447f9d090 100755
--- a/bin/ansible-doc
+++ b/bin/ansible-doc
@@ -141,7 +141,11 @@ def get_man_text(doc):
text.append("%s\n" % (ex['code']))
if 'plainexamples' in doc and doc['plainexamples'] is not None:
+ text.append("EXAMPLES:")
text.append(doc['plainexamples'])
+ if 'returndocs' in doc and doc['returndocs'] is not None:
+ text.append("RETURN VALUES:")
+ text.append(doc['returndocs'])
text.append('')
return "\n".join(text)
@@ -299,7 +303,7 @@ def main():
continue
try:
- doc, plainexamples = module_docs.get_docstring(filename)
+ doc, plainexamples, returndocs = module_docs.get_docstring(filename)
except:
traceback.print_exc()
sys.stderr.write("ERROR: module %s has a documentation error formatting or is missing documentation\n" % module)
@@ -317,6 +321,7 @@ def main():
doc['docuri'] = doc['module'].replace('_', '-')
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
doc['plainexamples'] = plainexamples
+ doc['returndocs'] = returndocs
if options.show_snippet:
text += get_snippet_text(doc)