mirror of https://github.com/ansible/ansible.git
ansible-doc: properly handle suboptions (#69795)
* Specifically handle suboptions, contains, etc in ansible-doc.pull/69951/head
parent
ff98ecc4d0
commit
840d3a9dd7
@ -0,0 +1,2 @@
|
||||
minor_changes:
|
||||
- "ansible-doc - improve suboptions formatting (https://github.com/ansible/ansible/pull/69795)."
|
@ -0,0 +1,70 @@
|
||||
#!/usr/bin/python
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: test_docs_suboptions
|
||||
short_description: Test module
|
||||
description:
|
||||
- Test module
|
||||
author:
|
||||
- Ansible Core Team
|
||||
options:
|
||||
with_suboptions:
|
||||
description:
|
||||
- An option with suboptions.
|
||||
- Use with care.
|
||||
type: dict
|
||||
suboptions:
|
||||
z_last:
|
||||
description: The last suboption.
|
||||
type: str
|
||||
m_middle:
|
||||
description:
|
||||
- The suboption in the middle.
|
||||
- Has its own suboptions.
|
||||
suboptions:
|
||||
a_suboption:
|
||||
description: A sub-suboption.
|
||||
type: str
|
||||
a_first:
|
||||
description: The first suboption.
|
||||
type: str
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
'''
|
||||
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
test_docs_suboptions=dict(
|
||||
type='dict',
|
||||
options=dict(
|
||||
a_first=dict(type='str'),
|
||||
m_middle=dict(
|
||||
type='dict',
|
||||
options=dict(
|
||||
a_suboption=dict(type='str')
|
||||
),
|
||||
),
|
||||
z_last=dict(type='str'),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
module.exit_json()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -0,0 +1,46 @@
|
||||
> TEST_DOCS_SUBOPTIONS (/home/felix/projects/code/github-cloned/ansible/test/integration/targets/ansible-doc/library/test_docs_suboptions.py)
|
||||
|
||||
Test module
|
||||
|
||||
OPTIONS (= is mandatory):
|
||||
|
||||
- with_suboptions
|
||||
An option with suboptions.
|
||||
Use with care.
|
||||
[Default: (null)]
|
||||
type: dict
|
||||
|
||||
SUBOPTIONS:
|
||||
|
||||
- a_first
|
||||
The first suboption.
|
||||
[Default: (null)]
|
||||
type: str
|
||||
|
||||
- m_middle
|
||||
The suboption in the middle.
|
||||
Has its own suboptions.
|
||||
[Default: (null)]
|
||||
|
||||
SUBOPTIONS:
|
||||
|
||||
- a_suboption
|
||||
A sub-suboption.
|
||||
[Default: (null)]
|
||||
type: str
|
||||
|
||||
- z_last
|
||||
The last suboption.
|
||||
[Default: (null)]
|
||||
type: str
|
||||
|
||||
|
||||
AUTHOR: Ansible Core Team
|
||||
|
||||
EXAMPLES:
|
||||
|
||||
|
||||
|
||||
|
||||
RETURN VALUES:
|
||||
|
Loading…
Reference in New Issue