From be5feead1469863982560b7cf75f5bfca627e21c Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 27 Sep 2016 12:52:29 -0400 Subject: [feature] try to launch backend on cli commands --- src/leap/bitmask/cli/bitmask_cli.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/leap/bitmask/cli/bitmask_cli.py') diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py index 64fe74b9..736e7376 100755 --- a/src/leap/bitmask/cli/bitmask_cli.py +++ b/src/leap/bitmask/cli/bitmask_cli.py @@ -95,7 +95,6 @@ GENERAL COMMANDS: return defer.succeed(None) def version(self, raw_args): - print(Fore.GREEN + 'bitmaskctl: ' + Fore.RESET + '0.0.1') self.data = ['version'] return self._send(printer=self._print_version) @@ -117,10 +116,20 @@ GENERAL COMMANDS: value + Fore.RESET) +@defer.inlineCallbacks def execute(): cli = BitmaskCLI() - d = cli.execute(sys.argv[1:]) - d.addCallback(lambda _: reactor.stop()) + cli.data = ['version'] + yield cli._send( + timeout=0.1, printer=_null_printer, + errb=lambda: cli.start(None)) + cli.data = [] + yield cli.execute(sys.argv[1:]) + yield reactor.stop() + + +def _null_printer(*args): + pass def main(): -- cgit v1.2.3