diff options
author | Ruben Pollan <meskio@sindominio.net> | 2016-06-28 18:29:28 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2016-07-03 16:04:41 +0200 |
commit | ff7c106ee5bd950bb87279188bde1c06c47507fb (patch) | |
tree | 488f6d8b8d7858734c3ba53791316cd05bfc4762 /src/leap/bitmask/cli | |
parent | eed534dcd28b2b85cf5e9c195c68d6d9c80bfb3e (diff) |
[feat] print list of keys nicely in the cli
Diffstat (limited to 'src/leap/bitmask/cli')
-rwxr-xr-x | src/leap/bitmask/cli/bitmask_cli.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py index 0c1fe832..e51a41b7 100755 --- a/src/leap/bitmask/cli/bitmask_cli.py +++ b/src/leap/bitmask/cli/bitmask_cli.py @@ -194,6 +194,19 @@ def do_print_result(stuff): print Fore.RED + 'ERROR:' + '%s' % obj['error'] + Fore.RESET +def do_print_key_list(stuff): + obj = json.loads(stuff[0]) + if obj['error']: + do_print_result(stuff) + return + + keys = obj['result'] + print Fore.GREEN + for key in keys: + print key["fingerprint"] + " " + key['address'] + print Fore.RESET + + def do_print_key(stuff): obj = json.loads(stuff[0]) if obj['error']: @@ -334,6 +347,7 @@ def send_command(cli): if subargs.list: data += ['list'] + cb = do_print_key_list elif subargs.export: data += ['export'] |