mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07: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:
parent
c195645575
commit
b3ce3fc5eb
7 changed files with 47 additions and 13 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue