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); };