Remove unused internal -a argument and functionality (#52602)
This commit is contained in:
parent
1ec376abca
commit
d1116ef2d8
2 changed files with 2 additions and 22 deletions
|
@ -61,8 +61,6 @@ class DocCLI(CLI):
|
|||
help='List available plugins')
|
||||
self.parser.add_option("-s", "--snippet", action="store_true", default=False, dest='show_snippet',
|
||||
help='Show playbook snippet for specified plugin(s)')
|
||||
self.parser.add_option("-a", "--all", action="store_true", default=False, dest='all_plugins',
|
||||
help='**For internal testing only** Show documentation for all plugins.')
|
||||
self.parser.add_option("-j", "--json", action="store_true", default=False, dest='json_dump',
|
||||
help='**For internal testing only** Dump json metadata for all plugins.')
|
||||
self.parser.add_option("-t", "--type", action="store", default='module', dest='type', type='choice',
|
||||
|
@ -73,17 +71,11 @@ class DocCLI(CLI):
|
|||
def post_process_args(self, options, args):
|
||||
options, args = super(DocCLI, self).post_process_args(options, args)
|
||||
|
||||
if [options.all_plugins, options.json_dump, options.list_dir, options.list_files, options.show_snippet].count(True) > 1:
|
||||
raise AnsibleOptionsError("Only one of -l, -F, -s, -j or -a can be used at the same time.")
|
||||
if [options.json_dump, options.list_dir, options.list_files, options.show_snippet].count(True) > 1:
|
||||
raise AnsibleOptionsError("Only one of -l, -F, -s, or -j can be used at the same time.")
|
||||
|
||||
display.verbosity = options.verbosity
|
||||
|
||||
# process all plugins of type
|
||||
if options.all_plugins:
|
||||
args = self.get_all_plugins_of_type(options.type)
|
||||
if options.module_path:
|
||||
display.warning('Ignoring "--module-path/-M" option as "--all/-a" only displays builtins')
|
||||
|
||||
return options, args
|
||||
|
||||
def run(self):
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
# Copyright: (c) 2019, Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.cli.doc import DocCLI
|
||||
|
||||
|
||||
def test_parsing_all_option():
|
||||
doc_cli = DocCLI(['/n/ansible-doc', '-a'])
|
||||
doc_cli.parse()
|
Loading…
Reference in a new issue