mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user