Fixes bug 1227
Change-Id: Ia6a314cd098d9d8fe5f0d19783cb59f69555c5a0
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
@cli_osm.command(name='vim-show', short_help='shows the details of a VIM account')
@click.argument('name')
@cli_osm.command(name='vim-show', short_help='shows the details of a VIM account')
@click.argument('name')
+@click.option('--filter', multiple=True,
+ help='restricts the information to the fields in the filter')
-def vim_show(ctx, name):
+def vim_show(ctx, name, filter):
"""shows the details of a VIM account
NAME: name or ID of the VIM account
"""shows the details of a VIM account
NAME: name or ID of the VIM account
table = PrettyTable(['key', 'attribute'])
for k, v in list(resp.items()):
table = PrettyTable(['key', 'attribute'])
for k, v in list(resp.items()):
- table.add_row([k, wrap_text(text=json.dumps(v, indent=2),width=100)])
+ if not filter or k in filter:
+ table.add_row([k, wrap_text(text=json.dumps(v, indent=2),width=100)])
table.align = 'l'
print(table)
table.align = 'l'
print(table)