Cleanups and fixes to cli

* Mark methods which are really functions as staticmethod
* Fix calls to other staticmethods to use the subclass rather than the
  base class so that any inheritance overriding will be honored.
* Remove unnecessary logic and dead code
* Fix a typo in a docstring of how to implement subclass init_parser()
  methods
* Call superclass's post_process_args in ansible-doc
* Fix copyright comment according to suggested practice
This commit is contained in:
Toshio Kuratomi 2018-12-19 20:45:47 -08:00
parent 7e92ff823e
commit ed8e60d804
9 changed files with 126 additions and 101 deletions

View file

@ -1,4 +1,4 @@
# Copyright: (c) 2017-2018, Ansible Project
# Copyright: (c) 2017, 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)
@ -62,7 +62,7 @@ class ConfigCLI(CLI):
self.parser.set_usage("usage: %prog update [options] [-c ansible.cfg] <search term>")
def post_process_args(self, options, args):
super(ConfigCLI, self).post_process_args(options, args)
options, args = super(ConfigCLI, self).post_process_args(options, args)
display.verbosity = options.verbosity
return options, args