summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-09-12 12:08:58 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-09-12 12:08:58 -0300
commit91f6dd2aaab40a099cd1dcba039215e08e3819e6 (patch)
tree50a19f2c137d7eb49eb911d89629a51c76ff7a5f
parent5d00da0874280eca3720ff010ff55590332468c1 (diff)
parent061c2aae0821f1e37b1de5b0347077ecfb276b65 (diff)
Merge remote-tracking branch 'kali/feature/add-version-flag' into develop
-rw-r--r--changes/feature_3816-add-version-flag1
-rw-r--r--docs/man/bitmask.1.rst2
-rw-r--r--src/leap/bitmask/app.py7
-rw-r--r--src/leap/bitmask/util/leap_argparse.py4
4 files changed, 12 insertions, 2 deletions
diff --git a/changes/feature_3816-add-version-flag b/changes/feature_3816-add-version-flag
new file mode 100644
index 00000000..cfbd2f67
--- /dev/null
+++ b/changes/feature_3816-add-version-flag
@@ -0,0 +1 @@
+ o Adds --version flag. Closes: #3816
diff --git a/docs/man/bitmask.1.rst b/docs/man/bitmask.1.rst
index 7a1d2ae1..ed4f7133 100644
--- a/docs/man/bitmask.1.rst
+++ b/docs/man/bitmask.1.rst
@@ -38,6 +38,8 @@ general options
**-s, --standalone** Makes Bitmask use standalone directories for configuration and binary searching.
+**-V, --version** Displays Bitmask version and exits.
+
openvpn options
---------------
diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py
index 158f1afe..8c839edc 100644
--- a/src/leap/bitmask/app.py
+++ b/src/leap/bitmask/app.py
@@ -24,6 +24,7 @@ from functools import partial
from PySide import QtCore, QtGui
+from leap.bitmask import __version__ as VERSION
from leap.bitmask.util import leap_argparse
from leap.bitmask.util import log_silencer
from leap.bitmask.util.leap_log_handler import LeapLogHandler
@@ -133,6 +134,11 @@ def main():
print "Could not ensure server: %r" % (e,)
_, opts = leap_argparse.init_leapc_args()
+
+ if opts.version:
+ print "Bitmask version: %s" % (VERSION,)
+ sys.exit(0)
+
standalone = opts.standalone
bypass_checks = getattr(opts, 'danger', False)
debug = opts.debug
@@ -156,7 +162,6 @@ def main():
from leap.bitmask.gui.mainwindow import MainWindow
from leap.bitmask.platform_init import IS_MAC
from leap.bitmask.platform_init.locks import we_are_the_one_and_only
- from leap.bitmask import __version__ as VERSION
from leap.bitmask.util.requirement_checker import check_requirements
# pylint: avoid unused import
diff --git a/src/leap/bitmask/util/leap_argparse.py b/src/leap/bitmask/util/leap_argparse.py
index bc21a9cf..afe5be48 100644
--- a/src/leap/bitmask/util/leap_argparse.py
+++ b/src/leap/bitmask/util/leap_argparse.py
@@ -27,7 +27,7 @@ def build_parser():
All the options for the leap arg parser
Some of these could be switched on only if debug flag is present!
"""
- epilog = "Copyright 2012 The LEAP Encryption Access Project"
+ epilog = "Copyright 2012-2013 The LEAP Encryption Access Project"
parser = argparse.ArgumentParser(description="""
Launches Bitmask""", epilog=epilog)
parser.add_argument('-d', '--debug', action="store_true",
@@ -50,6 +50,8 @@ Launches Bitmask""", epilog=epilog)
help='Makes Bitmask use standalone'
'directories for configuration and binary'
'searching')
+ parser.add_argument('-V', '--version', action="store_true",
+ help='Displays Bitmask version and exits')
# Not in use, we might want to reintroduce them.
#parser.add_argument('-i', '--no-provider-checks',