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:
parent
336000154a
commit
29861e076b
@ -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.
|
||||
|
@ -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"]
|
||||
)
|
||||
|
@ -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."""
|
||||
|
@ -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."""
|
||||
|
@ -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):
|
||||
|
@ -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"""
|
||||
|
@ -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."""
|
||||
|
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user