diff --git a/pros/cli/common.py b/pros/cli/common.py index 71c589c3..d658c7eb 100644 --- a/pros/cli/common.py +++ b/pros/cli/common.py @@ -253,11 +253,13 @@ def resolve_v5_port(port: Optional[str], type: str, quiet: bool = False) -> Tupl return None, False if len(ports) > 1: if not quiet: - port = click.prompt('Multiple {} ports were found. Please choose one: [{}]' - .format('v5', '|'.join([p.device for p in ports])), - default=ports[0].device, + brain_id = click.prompt('Multiple {} Brains were found. Please choose one to upload the program: [{}]' + .format('v5', ' | '.join([p.product.split(' ')[-1] for p in ports])), + default=ports[0].product.split(' ')[-1], show_default=False, - type=click.Choice([p.device for p in ports])) + type=click.Choice([p.description.split(' ')[-1] for p in ports])) + port = [p.device for p in ports if p.description.split(' ')[-1] == brain_id][0] + assert port in [p.device for p in ports] else: return None, False