Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output version string when --version is passed using optparse's version ... #715

Merged
merged 1 commit into from
Jul 30, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ansible/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import operator
from ansible import errors
from ansible import color
from ansible import __version__
import ansible.constants as C

try:
Expand Down Expand Up @@ -279,7 +280,7 @@ def format_help(self, formatter=None):
def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, async_opts=False, connect_opts=False):
''' create an options parser for any ansible script '''

parser = SortedOptParser(usage)
parser = SortedOptParser(usage, version="%prog " + __version__)
parser.add_option('-v','--verbose', default=False, action="store_true",
help='verbose mode')
parser.add_option('-f','--forks', dest='forks', default=constants.DEFAULT_FORKS, type='int',
Expand Down