Restore ansible --version output (#55728)

* Add custom action class for version info
* Use args from CLI as prog for ArgumentParser object
* Make prog a required parameter of create_base_parser() and update all uses to pass in the newly required parameter.
* Add unit test for checking ansible --version
* Update other related unit tests
This commit is contained in:
Sam Doran 2019-04-29 16:38:31 -04:00 committed by GitHub
commit b3ce3fc5eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 13 deletions

View file

@ -116,7 +116,7 @@ def opts_docs(cli_class_name, cli_module_name):
# instantiate each cli and ask its options
cli_klass = getattr(__import__("ansible.cli.%s" % cli_module_name,
fromlist=[cli_class_name]), cli_class_name)
cli = cli_klass([])
cli = cli_klass([cli_name])
# parse the common options
try:
@ -124,8 +124,6 @@ def opts_docs(cli_class_name, cli_module_name):
except Exception:
pass
cli.parser.prog = cli_name
# base/common cli info
docs = {
'cli': cli_module_name,