summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-09-27 15:36:56 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-27 16:19:26 -0400
commit62a0f06397e8229df648427d5e43da7267a20f4e (patch)
tree2c6b19024ffc85626b5ac11ed95e895cb2642970 /src/leap
parent6cf1751a4231d6454e69641655b6c5ea848bff6d (diff)
[feature] allow the frozen binary to function as cli too
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/bitmask/gui/app.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py
index c87ba88..4bd9190 100644
--- a/src/leap/bitmask/gui/app.py
+++ b/src/leap/bitmask/gui/app.py
@@ -68,8 +68,7 @@ class BrowserWindow(QtWidgets.QDialog):
sys.exit(1)
-def start_app():
-
+def launch_gui():
global qApp
global bitmaskd
@@ -86,5 +85,18 @@ def start_app():
sys.exit(qApp.exec_())
+def start_app():
+ from leap.bitmask.util import STANDALONE
+
+ # Allow the frozen binary in the bundle double as the cli entrypoint
+ # Why have only a user interface when you can have two?
+
+ if STANDALONE and len(sys.argv) > 1:
+ from leap.bitmask.cli import bitmask_cli
+ return bitmask_cli.main()
+
+ launch_gui()
+
+
if __name__ == "__main__":
start_app()