diff --git a/bashate/__init__.py b/bashate/__init__.py index 208cc14..1a320a6 100644 --- a/bashate/__init__.py +++ b/bashate/__init__.py @@ -14,4 +14,4 @@ import pbr.version __version__ = pbr.version.VersionInfo( - 'bashate').version_string() + 'bashate').version_string_with_vcs() diff --git a/bashate/bashate.py b/bashate/bashate.py index 0d92e00..e20df8b 100755 --- a/bashate/bashate.py +++ b/bashate/bashate.py @@ -22,6 +22,7 @@ import shlex import subprocess import sys +import bashate from bashate import messages MESSAGES = messages.MESSAGES @@ -431,9 +432,16 @@ def main(args=None): parser.add_argument('-e', '--error', help='Rules to always error (rather than warn)') parser.add_argument('-v', '--verbose', action='store_true', default=False) + parser.add_argument('--version', action='store_true', + help='show bashate version number and exit', + default=False) parser.add_argument('-s', '--show', action='store_true', default=False) opts = parser.parse_args(args) + if opts.version: + print("bashate: %s" % bashate.__version__) + sys.exit(0) + if opts.show: messages.print_messages() sys.exit(0)