1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

python: fix cli --file handling

It seems that Click doesn't do the right thing when argument and hidden
option with the same name exist, which was introduced in commit
2678e64a99.
This commit is contained in:
Martin Milata 2020-08-18 14:45:07 +02:00 committed by matejcik
parent 336000154a
commit 29861e076b
8 changed files with 10 additions and 8 deletions

View File

@ -52,7 +52,7 @@ def get_public_key(client, address, show_display):
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-n", "--address", required=True, help=PATH_HELP)
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@with_client
def sign_tx(client, address, file):
"""Sign Binance transaction.

View File

@ -39,7 +39,7 @@ def cli():
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@click.option(
"-p", "--protocol-magic", type=int, default=cardano.PROTOCOL_MAGICS["mainnet"]
)

View File

@ -43,7 +43,7 @@ def get_public_key(client, address, show_display):
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-n", "--address", required=True, help=PATH_HELP)
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@with_client
def sign_transaction(client, address, file):
"""Sign EOS transaction."""

View File

@ -54,7 +54,7 @@ def get_public_key(client, address, show_display):
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-n", "--address", required=True, help=PATH_HELP)
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@with_client
def sign_tx(client, address, file):
"""Sign Lisk transaction."""

View File

@ -44,7 +44,7 @@ def get_address(client, address, network, show_display):
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-n", "--address", required=True, help=PATH_HELP)
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@click.option("-b", "--broadcast", help="NIS to announce transaction to")
@with_client
def sign_tx(client, address, file, broadcast):

View File

@ -42,7 +42,7 @@ def get_address(client, address, show_display):
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-n", "--address", required=True, help=PATH_HELP)
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@with_client
def sign_tx(client, address, file):
"""Sign Ripple transaction"""

View File

@ -111,7 +111,9 @@ def flags(client, flags):
@click.argument(
"filename", type=click.Path(dir_okay=False, readable=True), required=False
)
@click.option("-f", "--filename", is_flag=True, hidden=True, expose_value=False)
@click.option(
"-f", "--filename", "_ignore", is_flag=True, hidden=True, expose_value=False
)
@with_client
def homescreen(client, filename):
"""Set new homescreen."""

View File

@ -52,7 +52,7 @@ def get_public_key(client, address, show_display):
@cli.command()
@click.argument("file", type=click.File("r"))
@click.option("-n", "--address", required=True, help=PATH_HELP)
@click.option("-f", "--file", is_flag=True, hidden=True, expose_value=False)
@click.option("-f", "--file", "_ignore", is_flag=True, hidden=True, expose_value=False)
@with_client
def sign_tx(client, address, file):
"""Sign Tezos transaction."""