summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli/user.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-02-16 13:44:14 +0100
committerRuben Pollan <meskio@sindominio.net>2017-02-23 00:27:09 +0100
commitff5ec25029db7669163854886be254fccde90e80 (patch)
treecd0098ed9c4d3c840c053f9c794b687fcd3243d5 /src/leap/bitmask/cli/user.py
parent59cd23bd3e23bf2b439ad26271733a1b5c8edf68 (diff)
[feat] add json print to cli
To improve scriptability we add '--json' param to the cli. - Resolves: #8771
Diffstat (limited to 'src/leap/bitmask/cli/user.py')
-rw-r--r--src/leap/bitmask/cli/user.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/leap/bitmask/cli/user.py b/src/leap/bitmask/cli/user.py
index a5cad1b..1ab3630 100644
--- a/src/leap/bitmask/cli/user.py
+++ b/src/leap/bitmask/cli/user.py
@@ -45,8 +45,8 @@ SUBCOMMANDS:
'''.format(name=command.appname)
- def __init__(self, cfg):
- super(User, self).__init__(cfg)
+ def __init__(self, *args, **kwargs):
+ super(User, self).__init__(*args, **kwargs)
self.data.append('user')
def create(self, raw_args):
@@ -116,7 +116,9 @@ SUBCOMMANDS:
return self._send(printer=command.default_dict_printer)
def active(self, raw_args):
- username = self.cfg.get('bonafide', 'active', default='<none>')
+ username = self.cfg.get('bonafide', 'active', default='')
+ if not username:
+ username = '<none>'
print(Fore.RESET + 'active'.ljust(10) + Fore.GREEN + username +
Fore.RESET)
return defer.succeed(None)