From 9ca0289dee30686648154fe294b07811b21aeea7 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 11 May 2013 16:29:41 -0400 Subject: [PATCH] Fixup the module formatter to explain the EXAMPLES string as well. --- examples/DOCUMENTATION.yaml | 2 +- hacking/module_formatter.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/DOCUMENTATION.yaml b/examples/DOCUMENTATION.yaml index f5c285932a..da434005fd 100644 --- a/examples/DOCUMENTATION.yaml +++ b/examples/DOCUMENTATION.yaml @@ -26,4 +26,4 @@ options: default: a string or the word null choices: [list, of, choices] aliases: [list, of, aliases] - version_added: 0.X + version_added: 1.X diff --git a/hacking/module_formatter.py b/hacking/module_formatter.py index b62d5af09d..7eb1e106fb 100755 --- a/hacking/module_formatter.py +++ b/hacking/module_formatter.py @@ -136,7 +136,10 @@ def return_data(text, options, outputname, module): def boilerplate(): if not os.path.exists(EXAMPLE_YAML): print >>sys.stderr, "Missing example boiler plate: %S" % EXAMPLE_YAML + print "DOCUMENTATION = '''" print file(EXAMPLE_YAML).read() + print "'''" + print "" def list_modules(module_dir): categories = {} @@ -217,6 +220,14 @@ def main(): if options.do_boilerplate: boilerplate() + + print "" + print "EXAMPLES = '''" + print "# example of doing ___ from a playbook" + print "your_module: some_arg=1 other_arg=2" + print "'''" + print "" + sys.exit(0) if not options.module_dir: