From c9325ca2479305184ba19cc76708555307e81a03 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 10 Dec 2018 10:40:19 +0530 Subject: [PATCH] Override help string version (#49545) This fix adds additional help message to version command options Fixes: #20488 Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/49545-ansible-doc_version_help.yaml | 2 ++ lib/ansible/cli/__init__.py | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 changelogs/fragments/49545-ansible-doc_version_help.yaml diff --git a/changelogs/fragments/49545-ansible-doc_version_help.yaml b/changelogs/fragments/49545-ansible-doc_version_help.yaml new file mode 100644 index 0000000000..c90c09cdfd --- /dev/null +++ b/changelogs/fragments/49545-ansible-doc_version_help.yaml @@ -0,0 +1,2 @@ +minor_changes: +- Updated Ansible version help message in help section. diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py index 6b2079c701..7cf58619e6 100644 --- a/lib/ansible/cli/__init__.py +++ b/lib/ansible/cli/__init__.py @@ -417,6 +417,10 @@ class CLI(with_metaclass(ABCMeta, object)): # base opts parser = SortedOptParser(usage, version=CLI.version("%prog"), description=desc, epilog=epilog) + parser.remove_option('--version') + version_help = "show program's version number, config file location, configured module search path," \ + " module location, executable location and exit" + parser.add_option('--version', action="version", help=version_help) parser.add_option('-v', '--verbose', dest='verbosity', default=C.DEFAULT_VERBOSITY, action="count", help="verbose mode (-vvv for more, -vvvv to enable connection debugging)")