module_formatter fixes

This commit is contained in:
Jan-Piet Mens
2012-09-28 09:59:43 +02:00
parent 06cfc52afd
commit 62d038dca4
4 changed files with 31 additions and 102 deletions

View File

@@ -13,24 +13,19 @@
."
{% if options is defined -%}
.SH OPTIONS
{% for o in options -%}{% for opt, v in o.iteritems() -%}
.IP @{opt}@
{% for desc in v.description -%}
@{ desc | jpfunc }@
{% endfor -%}
{% if v['required'] %}(required){% endif -%}
{% if v['choices'] -%}
." .SS Choices
{% for (k,v) in options.iteritems() %}
.IP @{ k }@
{% for desc in v.description -%}@{ desc | jpfunc }@{% endfor -%}
{% if v.get('choices') %}
.IR Choices :
{% for choice in v['choices'] -%}@{ choice }@{% if not loop.last %},{% else %}.{% endif -%}
{% endfor -%}
{% endif %}
{% for choice in v.get('choices',[]) -%}@{ choice }@{% if not loop.last %},{%else%}.{%endif-%}{% endfor -%}{% endif %}
{% if v.get('required') %}(required){% endif -%}
{% if v.get('default') %} (default: @{ v.get('default') }@){% endif -%}
{#---------------------------------------------- #}
{% if v['version_added'] is defined -%}
(Added in Ansible version @{ v['version_added'] }@.)
{% if v.get('version_added') -%}
(Added in Ansible version @{ v.get('version_added') }@.)
{% endif -%}
{% endfor -%}
{% endfor -%}
{% endfor %}
{% endif %}
."
."