mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 07:50:57 +00:00
Added --verbose parameter to comdtr
This commit is contained in:
parent
e4fe84cb52
commit
6f2a60f932
9
cmdtr.py
9
cmdtr.py
@ -5,12 +5,13 @@ import argparse
|
||||
import json
|
||||
import base64
|
||||
|
||||
from trezorlib.client import TrezorClient
|
||||
from trezorlib.client import TrezorClient, TrezorClientDebug
|
||||
from trezorlib.tx_api import TXAPIBitcoin
|
||||
from trezorlib.protobuf_json import pb2json
|
||||
|
||||
def parse_args(commands):
|
||||
parser = argparse.ArgumentParser(description='Commandline tool for Trezor devices.')
|
||||
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', help='Prints communication to device')
|
||||
parser.add_argument('-t', '--transport', dest='transport', choices=['usb', 'serial', 'pipe', 'socket'], default='usb', help="Transport used for talking with the device")
|
||||
parser.add_argument('-p', '--path', dest='path', default='', help="Path used by the transport (usually serial port)")
|
||||
# parser.add_argument('-dt', '--debuglink-transport', dest='debuglink_transport', choices=['usb', 'serial', 'pipe', 'socket'], default='usb', help="Debuglink transport")
|
||||
@ -349,7 +350,11 @@ def main():
|
||||
return
|
||||
|
||||
transport = get_transport(args.transport, args.path)
|
||||
client = TrezorClient(transport)
|
||||
if args.verbose:
|
||||
client = TrezorClientDebug(transport)
|
||||
else:
|
||||
client = TrezorClient(transport)
|
||||
|
||||
client.set_tx_api(TXAPIBitcoin())
|
||||
cmds = Commands(client)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user