mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Fixup the module formatter to explain the EXAMPLES string as well.
This commit is contained in:
parent
0748e86f0e
commit
9ca0289dee
2 changed files with 12 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue