summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli/bitmask_cli.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-09-27 12:52:29 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-27 12:53:23 -0400
commitbe5feead1469863982560b7cf75f5bfca627e21c (patch)
treefefc12c281c9dbf158591458313c1c6d44487cd8 /src/leap/bitmask/cli/bitmask_cli.py
parent321dd225e40be8f3e0c2e058f831ab804ca622b0 (diff)
[feature] try to launch backend on cli commands
Diffstat (limited to 'src/leap/bitmask/cli/bitmask_cli.py')
-rwxr-xr-xsrc/leap/bitmask/cli/bitmask_cli.py15
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():