From 7697beb7034acacbe6964af0385a03b2ea33ec93 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 26 Jan 2018 22:53:39 +0100 Subject: [feat] help string for bitmask gui - Resolves: #8794 --- src/leap/bitmask/cli/bitmask_cli.py | 1 - src/leap/bitmask/gui/app.py | 32 +++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py index 40f119e9..b048bb69 100755 --- a/src/leap/bitmask/cli/bitmask_cli.py +++ b/src/leap/bitmask/cli/bitmask_cli.py @@ -62,7 +62,6 @@ GENERAL COMMANDS: OPTIONAL ARGUMENTS: --json print the raw json (useful for scripting) - ''' epilog = ("Use 'bitmaskctl help' to learn more " "about each command.") diff --git a/src/leap/bitmask/gui/app.py b/src/leap/bitmask/gui/app.py index 4a62adf6..d52636c2 100644 --- a/src/leap/bitmask/gui/app.py +++ b/src/leap/bitmask/gui/app.py @@ -223,6 +223,19 @@ def launch_gui(with_window=True): sys.exit(qApp.exec_()) +usage = '''bitmask [] + +Launches the Bitmask GUI. + +OPTIONAL ARGUMENTS: + + --nowindow does not launch the main window, only the systray. + +SEE ALSO: + + bitmaskctl controls bitmask daemon from the command line. +''' + def start_app(): from leap.bitmask.util import STANDALONE @@ -242,13 +255,18 @@ def start_app(): MIN_ARGS = 1 # DEBUG ==================================== - if STANDALONE and len(sys.argv) > MIN_ARGS: - if sys.argv[1] == 'bitmask_helpers': - from leap.bitmask.vpn.helpers import main - return main() - - from leap.bitmask.cli import bitmask_cli - return bitmask_cli.main() + if len(sys.argv) > MIN_ARGS: + if STANDALONE: + if sys.argv[1] == 'bitmask_helpers': + from leap.bitmask.vpn.helpers import main + return main() + + from leap.bitmask.cli import bitmask_cli + return bitmask_cli.main() + else: + if sys.argv[1] == '--help' or sys.argv[1] == 'help': + print(usage) + sys.exit() reset_authtoken() with_window = '--nowindow' not in sys.argv -- cgit v1.2.3