@@ -269,8 +269,9 @@ def main(prog=None) -> int:
269
269
'to use a hex seed, prefix it with "hex:"' )
270
270
parser .add_argument ('-t' , '--trace' , action = 'store_true' , help = 'Trace syscalls' )
271
271
parser .add_argument ('-u' , '--usb' , default = 'hid' , help = 'Configure the USB transport protocol, '
272
- 'either HID (default) or U2F' )
273
- parser .add_argument ('--nfc' , action = 'store_true' , help = 'Use NFC transport instead of USB' )
272
+ 'either HID (default) or U2F (DEPRECATED, use `--transport` instead)' )
273
+ parser .add_argument ('-T' , '--transport' , default = None , choices = ('HID' , 'U2F' , 'NFC' ),
274
+ help = 'Configure the transport protocol: HID (default), U2F or NFC.' )
274
275
275
276
group = parser .add_argument_group ('network arguments' )
276
277
group .add_argument ('--apdu-port' , default = 9999 , type = int , help = 'ApduServer TCP port' )
@@ -468,14 +469,20 @@ def main(prog=None) -> int:
468
469
qemu_pid = run_qemu (s1 , s2 , args , use_bagl )
469
470
s1 .close ()
470
471
472
+ # The `--transport` argument takes precedence over `--usb`
473
+ if args .transport is not None :
474
+ transport_type = TransportType [args .transport ]
475
+ else :
476
+ transport_type = TransportType [args .usb .upper ()]
477
+
471
478
apdu = apdu_server .ApduServer (host = "0.0.0.0" , port = args .apdu_port )
472
479
seph = seproxyhal .SeProxyHal (
473
480
s2 ,
474
481
model = args .model ,
475
482
use_bagl = use_bagl ,
476
483
automation = automation_path ,
477
484
automation_server = automation_server ,
478
- transport = TransportType . NFC if args . nfc else TransportType [ args . usb . upper ()] )
485
+ transport = transport_type )
479
486
480
487
button = None
481
488
if args .button_port :
0 commit comments