ansible-doc fix displaying 'CLI' options for plugin docs

cli options will now display either use provided info, or automating from the name


Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
pull/74318/head
Brian Coca 3 years ago committed by GitHub
parent 6a883f1cd6
commit 26827f5039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- ansible-doc pretty cli options output.

@ -1043,6 +1043,15 @@ class DocCLI(CLI, RoleMixin):
if ignore in item:
del item[ignore]
if 'cli' in opt and opt['cli']:
conf['cli'] = []
for cli in opt['cli']:
if 'option' not in cli:
conf['cli'].append({'name': cli['name'], 'option': '--%s' % cli['name'].replace('_', '-')})
else:
conf['cli'].append(cli)
del opt['cli']
if conf:
text.append(DocCLI._dump_yaml({'set_via': conf}, opt_indent))

@ -232,6 +232,7 @@ DOCUMENTATION = '''
- name: ansible_ssh_private_key_file
cli:
- name: private_key_file
option: '--private-key'
control_path:
description:

Loading…
Cancel
Save