From 62a0f06397e8229df648427d5e43da7267a20f4e Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 27 Sep 2016 15:36:56 -0400 Subject: [feature] allow the frozen binary to function as cli too --- src/leap/bitmask/gui/app.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py index c87ba88e..4bd91909 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() -- cgit v1.2.3