Skip to content

Commit

Permalink
feat: implement desc view on list
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed Mar 25, 2024
1 parent a4c738c commit abc3df4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,12 @@ pub async fn handle_mode(mode: &str, args: &ArgMatches) -> (Args, u8) {
println!("List of network interfaces");
println!("--------------------------");
for (i, device) in Device::list().unwrap().iter().enumerate() {
println!("[{}] {}", i, device.name);
print!("[{}] {:25}", i, device.name);
let description = &device.desc;
if let Some(desc) = description {
print!(" - {}", desc);
}
println!();
}
exit(0);
}
Expand Down

0 comments on commit abc3df4

Please sign in to comment.