plugin_formatter.py: accept multiple template dirs (#49765)
this allows to override certain templates without copying the whole template directory
This commit is contained in:
parent
9202ef60b0
commit
32dbb99bb8
1 changed files with 3 additions and 1 deletions
|
@ -334,7 +334,7 @@ def generate_parser():
|
||||||
p.add_option("-A", "--ansible-version", action="store", dest="ansible_version", default="unknown", help="Ansible version number")
|
p.add_option("-A", "--ansible-version", action="store", dest="ansible_version", default="unknown", help="Ansible version number")
|
||||||
p.add_option("-M", "--module-dir", action="store", dest="module_dir", default=MODULEDIR, help="Ansible library path")
|
p.add_option("-M", "--module-dir", action="store", dest="module_dir", default=MODULEDIR, help="Ansible library path")
|
||||||
p.add_option("-P", "--plugin-type", action="store", dest="plugin_type", default='module', help="The type of plugin (module, lookup, etc)")
|
p.add_option("-P", "--plugin-type", action="store", dest="plugin_type", default='module', help="The type of plugin (module, lookup, etc)")
|
||||||
p.add_option("-T", "--template-dir", action="store", dest="template_dir", default="hacking/templates", help="directory containing Jinja2 templates")
|
p.add_option("-T", "--template-dir", action="append", dest="template_dir", help="directory containing Jinja2 templates")
|
||||||
p.add_option("-t", "--type", action='store', dest='type', choices=['rst'], default='rst', help="Document type")
|
p.add_option("-t", "--type", action='store', dest='type', choices=['rst'], default='rst', help="Document type")
|
||||||
p.add_option("-o", "--output-dir", action="store", dest="output_dir", default=None, help="Output directory for module files")
|
p.add_option("-o", "--output-dir", action="store", dest="output_dir", default=None, help="Output directory for module files")
|
||||||
p.add_option("-I", "--includes-file", action="store", dest="includes_file", default=None, help="Create a file containing list of processed modules")
|
p.add_option("-I", "--includes-file", action="store", dest="includes_file", default=None, help="Create a file containing list of processed modules")
|
||||||
|
@ -651,6 +651,8 @@ def main():
|
||||||
# INIT
|
# INIT
|
||||||
p = generate_parser()
|
p = generate_parser()
|
||||||
(options, args) = p.parse_args()
|
(options, args) = p.parse_args()
|
||||||
|
if not options.template_dir:
|
||||||
|
options.template_dir = ["hacking/templates"]
|
||||||
validate_options(options)
|
validate_options(options)
|
||||||
display.verbosity = options.verbosity
|
display.verbosity = options.verbosity
|
||||||
plugin_type = options.plugin_type
|
plugin_type = options.plugin_type
|
||||||
|
|
Loading…
Reference in a new issue