diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-27 12:52:29 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-27 12:53:23 -0400 |
commit | be5feead1469863982560b7cf75f5bfca627e21c (patch) | |
tree | fefc12c281c9dbf158591458313c1c6d44487cd8 /src/leap/bitmask/cli/bitmask_cli.py | |
parent | 321dd225e40be8f3e0c2e058f831ab804ca622b0 (diff) |
[feature] try to launch backend on cli commands
Diffstat (limited to 'src/leap/bitmask/cli/bitmask_cli.py')
-rwxr-xr-x | src/leap/bitmask/cli/bitmask_cli.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py index 64fe74b..736e737 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(): |