Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bhwi-cli/src/bin/bhwi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ async fn main() -> Result<()> {
let dev_man = DeviceManager::new(config);
match command {
Commands::Device(DeviceCommands::List { format }) => {
let devices = dev_man.enumerate().await?;
for (i, mut device) in devices.into_iter().enumerate() {
let mut devices = dev_man.enumerate().await?;
for (i, device) in devices.iter_mut().enumerate() {
device.device().unlock(dev_man.config.network).await?;
let fingerprint = device.fingerprint().await?;
let name = device.name();
Expand All @@ -90,10 +90,13 @@ async fn main() -> Result<()> {
println!("{name:<18} | {is_emulated:<8} | {fingerprint:<15}");
println!("{}", "-".repeat(55));
}
Some(ListFormat::Json) => println!("{}", serde_json::to_string(&device)?),
Some(ListFormat::Json) => {}
None => println!("{fingerprint}"),
}
}
if let Some(ListFormat::Json) = format {
println!("{}", serde_json::json![devices])
}
}
Commands::Xpub(XpubCommands::Get { path }) => {
if let Some(mut d) = dev_man.get_device_with_fingerprint().await? {
Expand Down
Loading