Skip to content

Commit

Permalink
Add --print-location for BentoML get command (#825)
Browse files Browse the repository at this point in the history
* add print_location flag

* add python like jq interp option

* fix test import and linting issues

* fix typo lmao

* linter

* fix more linting issues and address review comments

* remove jq-like parsing stuff
  • Loading branch information
jackyzha0 committed Jun 24, 2020
1 parent 150bc65 commit 05aea90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bentoml/cli/bento.py
Expand Up @@ -92,10 +92,11 @@ def add_bento_sub_command(cli):
'--limit', type=click.INT, help='Limit how many resources will be retrieved'
)
@click.option('--ascending-order', is_flag=True)
@click.option('--print-location', is_flag=True)
@click.option(
'-o', '--output', type=click.Choice(['json', 'yaml', 'table', 'wide'])
)
def get(bento, limit, ascending_order, output):
def get(bento, limit, ascending_order, print_location, output):
if ':' in bento:
name, version = bento.split(':')
else:
Expand All @@ -117,6 +118,9 @@ def get(bento, limit, ascending_order, output):
CLI_COLOR_ERROR,
)
return
if print_location:
_echo(get_bento_result.bento.uri.uri)
return
_print_bento_info(get_bento_result.bento, output)
return
elif name:
Expand Down

0 comments on commit 05aea90

Please sign in to comment.