Now printing the list of all available ports (Wokňous issue?)

This commit is contained in:
2025-09-24 13:28:44 +02:00
parent a637486847
commit 329f7e1284

View File

@@ -330,6 +330,25 @@ fn main() {
let Some(port) = port else { let Some(port) = port else {
println!("Could not find any compatible serial port. Please make sure that the target is connected."); 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!("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); std::process::exit(1);
}; };