fix: improve error message when user passes in only api and url

Also change enable to enabled.

Before if a user passed in --api and --url TEXT the error message would
return a confusing message that the user must pass in url when api is
enabled.

Now the error message says the user must provide url and token when api
is enabled.

Change-Id: I3284a7e1f920217dc476abcdd1fc17701c85655e
This commit is contained in:
Dustin Specker 2019-07-17 13:12:07 -05:00
parent 46bb9bd8b3
commit caa75e403e
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ def main(ctx, debug, api, url, token):
if api:
if not url or not token:
raise click.ClickException(
'When api option is enable user needs to pass url')
'When api option is enabled user needs to pass url and token')
else:
ctx.obj['api'] = api
parsed_url = urlparse(url)