Add a wipe command

This commit is contained in:
Andrew Chow 2018-12-29 00:10:45 -05:00
parent 8a0d36ec07
commit 67236e926f

View File

@ -208,6 +208,12 @@ def setup_device(args, client):
except ValueError as e:
return {'error': str(e), 'code': BAD_ARGUMENT}
def wipe_device(args, client):
try:
return client.wipe_device()
except UnavailableActionError as e:
return {'error': str(e), 'code': UNAVAILABLE_ACTION}
def process_commands(args):
parser = argparse.ArgumentParser(description='Access and send commands to a hardware wallet device. Responses are in JSON format')
parser.add_argument('--device-path', '-d', help='Specify the device path of the device to connect to')
@ -263,6 +269,9 @@ def process_commands(args):
setupdev_parser.add_argument('--backup_passphrase', '-b', help='The passphrase to use for the backup, if applicable', default='')
setupdev_parser.set_defaults(func=setup_device)
wipedev_parser = subparsers.add_parser('wipe', help='Wipe a device')
wipedev_parser.set_defaults(func=wipe_device)
args = parser.parse_args(args)
device_path = args.device_path