Skip to content

Commit

Permalink
Update Client call in main CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuhs committed Jan 29, 2020
1 parent 676c2aa commit f422524
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mythx_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __call__(self, *args, **kwargs):

@click.group(cls=APIErrorCatcherGroup)
@click.option("--debug", is_flag=True, default=False, envvar="MYTHX_DEBUG", help="Provide additional debug output")
@click.option("--api-key", envvar="MYTHX_API_KEY", help="Your MythX API access token")
@click.option("--api-key", envvar="MYTHX_API_KEY", help="Your MythX API key from the dashboard")
@click.option("--username", envvar="MYTHX_USERNAME", help="Your MythX account's username")
@click.option("--password", envvar="MYTHX_PASSWORD", help="Your MythX account's password")
@click.option(
Expand All @@ -69,7 +69,7 @@ def cli(ctx, **kwargs):
:param ctx: Click context holding group-level parameters
:param debug: Boolean to enable the `logging` debug mode
:param api_key: User JWT access token from the MythX dashboard
:param api_key: User JWT api token from the MythX dashboard
:param username: The MythX account ETH address/username
:param password: The account password from the MythX dashboard
:param fmt: The formatter to use for the subcommand output
Expand All @@ -81,10 +81,10 @@ def cli(ctx, **kwargs):
ctx.obj["retval"] = 0
toolname_mw = ClientToolNameMiddleware(name="mythx-cli-{}".format(__version__))
if kwargs["api_key"] is not None:
ctx.obj["client"] = Client(access_token=kwargs["api_key"], middlewares=[toolname_mw])
ctx.obj["client"] = Client(api_key=kwargs["api_key"], middlewares=[toolname_mw])
elif kwargs["username"] and kwargs["password"]:
ctx.obj["client"] = Client(
eth_address=kwargs["username"], password=kwargs["password"], middlewares=[toolname_mw]
username=kwargs["username"], password=kwargs["password"], middlewares=[toolname_mw]
)
else:
raise click.UsageError(
Expand Down

0 comments on commit f422524

Please sign in to comment.