mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Change ansible-doc usage to show -a is for internal use (#29603)
* Change ansible-doc usage to show -a is for internal use ansible-doc -a is for testing that documentation is sane. It should not be used by normal users in production. The main reason for this is that it is designed to fail if there are any undocumented modules or plugins. This is good for testing that all plugins we ship are documented. It is not good for end users who may have undocumented third-party plugins.
This commit is contained in:
parent
3277e6328b
commit
cfaea8a053
1 changed files with 3 additions and 3 deletions
|
@ -54,7 +54,7 @@ class DocCLI(CLI):
|
||||||
def parse(self):
|
def parse(self):
|
||||||
|
|
||||||
self.parser = CLI.base_parser(
|
self.parser = CLI.base_parser(
|
||||||
usage='usage: %prog [-l|-s|-a] [options] [-t <plugin type] [plugin]',
|
usage='usage: %prog [-l|-s] [options] [-t <plugin type] [plugin]',
|
||||||
module_opts=True,
|
module_opts=True,
|
||||||
desc="plugin documentation tool",
|
desc="plugin documentation tool",
|
||||||
epilog="See man pages for Ansible CLI options or website for tutorials https://docs.ansible.com"
|
epilog="See man pages for Ansible CLI options or website for tutorials https://docs.ansible.com"
|
||||||
|
@ -65,7 +65,7 @@ class DocCLI(CLI):
|
||||||
self.parser.add_option("-s", "--snippet", action="store_true", default=False, dest='show_snippet',
|
self.parser.add_option("-s", "--snippet", action="store_true", default=False, dest='show_snippet',
|
||||||
help='Show playbook snippet for specified plugin(s)')
|
help='Show playbook snippet for specified plugin(s)')
|
||||||
self.parser.add_option("-a", "--all", action="store_true", default=False, dest='all_plugins',
|
self.parser.add_option("-a", "--all", action="store_true", default=False, dest='all_plugins',
|
||||||
help='Show documentation for all plugins')
|
help='**For internal testing only** Show documentation for all plugins.')
|
||||||
self.parser.add_option("-t", "--type", action="store", default='module', dest='type', type='choice',
|
self.parser.add_option("-t", "--type", action="store", default='module', dest='type', type='choice',
|
||||||
help='Choose which plugin type (defaults to "module")',
|
help='Choose which plugin type (defaults to "module")',
|
||||||
choices=['cache', 'callback', 'connection', 'inventory', 'lookup', 'module', 'strategy', 'vars'])
|
choices=['cache', 'callback', 'connection', 'inventory', 'lookup', 'module', 'strategy', 'vars'])
|
||||||
|
@ -73,7 +73,7 @@ class DocCLI(CLI):
|
||||||
super(DocCLI, self).parse()
|
super(DocCLI, self).parse()
|
||||||
|
|
||||||
if [self.options.all_plugins, self.options.list_dir, self.options.show_snippet].count(True) > 1:
|
if [self.options.all_plugins, self.options.list_dir, self.options.show_snippet].count(True) > 1:
|
||||||
raise AnsibleOptionsError("Only one of -l, -a or -s can be used at the same time.")
|
raise AnsibleOptionsError("Only one of -l, -s or -a can be used at the same time.")
|
||||||
|
|
||||||
display.verbosity = self.options.verbosity
|
display.verbosity = self.options.verbosity
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue