Skip to content

Commit

Permalink
Add list-ports command to show the available serial ports.
Browse files Browse the repository at this point in the history
  • Loading branch information
AVee committed Feb 11, 2025
1 parent be132b1 commit 30eca8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cargo-espflash/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ enum Commands {
HoldInReset(ConnectArgs),
/// List serial ports available for flashing.
///
/// Only lists ports of devices known to be used on development boards. Use -a to show all
/// available ports.
/// Only lists ports of devices known to be used on development boards. Use
/// -a to show all available ports.
ListPorts(ListPortsArgs),
/// Open the serial monitor without flashing the connected target device
Monitor(MonitorArgs),
Expand Down
4 changes: 2 additions & 2 deletions espflash/src/bin/espflash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ enum Commands {
HoldInReset(ConnectArgs),
/// List serial ports available for flashing.
///
/// Only lists ports of devices known to be used on development boards. Use -a to show all
/// available ports.
/// Only lists ports of devices known to be used on development boards. Use
/// -a to show all available ports.
ListPorts(ListPortsArgs),
/// Open the serial monitor without flashing the connected target device
Monitor(MonitorArgs),
Expand Down
2 changes: 1 addition & 1 deletion espflash/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ pub fn checksum_md5(args: &ChecksumMd5Args, config: &Config) -> Result<()> {
pub fn list_ports(args: &ListPortsArgs, config: &Config) -> Result<()> {
let mut ports: Vec<SerialPortInfo> = serial::detect_usb_serial_ports(true)?
.into_iter()
.filter(|p| args.all_ports || serial::known_ports_filter(&p, config))
.filter(|p| args.all_ports || serial::known_ports_filter(p, config))
.collect();
if ports.is_empty() {
if !args.name_only {
Expand Down

0 comments on commit 30eca8b

Please sign in to comment.