Skip to content

Commit

Permalink
Column output for list-ports command
Browse files Browse the repository at this point in the history
  • Loading branch information
AVee committed Feb 14, 2025
1 parent a9fe2d3 commit 5e9c894
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.
///
/// The default behavior is to only list ports of devices known to be used on development
/// boards.
/// The default behavior is to only list ports of devices known to be used
/// on development boards.
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.
///
/// The default behavior is to only list ports of devices known to be used on development
/// boards.
/// The default behavior is to only list ports of devices known to be used
/// on development boards.
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 @@ -407,7 +407,7 @@ pub fn list_ports(args: &ListPortsArgs, config: &Config) -> Result<()> {
let name_width = ports.iter().map(|p| p.port_name.len()).max().unwrap_or(13) + 2;
let manufacturer_width = ports.iter().filter_map(|p|
match &p.port_type {
SerialPortType::UsbPort(p) => p.manufacturer.as_ref().map_or(None, |m| Some(m.len())),
SerialPortType::UsbPort(p) => p.manufacturer.as_ref().map(|m| m.len()),
_ => None
})
.max().unwrap_or(15) + 2;
Expand Down

0 comments on commit 5e9c894

Please sign in to comment.