Skip to content

Commit

Permalink
don't show tip in json format
Browse files Browse the repository at this point in the history
  • Loading branch information
amalfra committed Jul 5, 2018
1 parent 8a56964 commit 3508f32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ def main():
command = importlib.import_module('src.commands.' + args.method)
command.run(docker_hub_client, args)

if args.method not in NO_TIP_METHODS and not login_token_present:
if args.method not in NO_TIP_METHODS and args.format not in \
NO_TIP_FORMATS and not login_token_present:
print('\nTip: ' + TIPS[0])
1 change: 1 addition & 0 deletions src/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
VALID_METHODS = ['repos', 'tags', 'builds', 'users', 'queue', 'version',
'login']
NO_TIP_METHODS = ['login', 'version']
NO_TIP_FORMATS = ['json']
VALID_DISPLAY_FORMATS = ['table', 'json']
DOCKER_AUTH_FILE = '~/.docker/config.json'
CONFIG_FILE = '~/.docker-hub/config.json'
Expand Down

0 comments on commit 3508f32

Please sign in to comment.