Add --release option.

Now that PBR is integrated, we can get more specific version information
that includes the full release string, as pulled from 'git describe':

${latest-tag}.${num_of_commits_since_tag}.${git_short_sha}

Change-Id: I81c466b429c88f6e32b6968b34f8ccf255ba6c50
This commit is contained in:
David Shrewsbury
2013-04-12 09:43:17 -04:00
parent ca8408e595
commit feb1ea2bdc
2 changed files with 9 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ import os.path
import sys
import ConfigParser
from libra import __version__
from libra import __version__, __release__
from logging_handler import CompressedTimedRotatingFileHandler
"""
@@ -114,6 +114,10 @@ class Options(object):
'--version', dest='version', action='store_true',
help='print version and exit'
)
self.parser.add_argument(
'--release', dest='release', action='store_true',
help='print full release version info and exit'
)
self.parser.add_argument(
'-n', '--nodaemon', dest='nodaemon', action='store_true',
help='do not run in daemon mode'
@@ -159,6 +163,9 @@ class Options(object):
if args.version:
print("Libra toolset version %s" % __version__)
sys.exit(0)
if args.release:
print("Libra toolset release %s" % __release__)
sys.exit(0)
return args