From 329f7e128422277f02ad6a6faa39aacbc6c1dbe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Proch=C3=A1zka?= Date: Wed, 24 Sep 2025 13:28:44 +0200 Subject: [PATCH] =?UTF-8?q?Now=20printing=20the=20list=20of=20all=20availa?= =?UTF-8?q?ble=20ports=20(Wok=C5=88ous=20issue=3F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main.rs b/src/main.rs index 48feeb9..130587f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -330,6 +330,25 @@ fn main() { let Some(port) = port else { println!("Could not find any compatible serial port. Please make sure that the target is connected."); println!("If the issue persists, please specify the port manually with the `--port ...` argument."); + println!(); + + let ports = serial_enumerator::get_serial_list(); + + if ports.is_empty() { + println!("No usable ports detected."); + } + + if !ports.is_empty() { + println!("Possible ports:"); + + for port in serial_enumerator::get_serial_list() { + println!(" - {} ({}, {})", + port.name, + port.vendor.unwrap_or_else(|| "unknown vendor".to_string()), + port.product.unwrap_or_else(|| "unknown product".to_string())); + } + } + std::process::exit(1); };