Don't print the detection banner if no devices were detected.

This commit is contained in:
David Given
2024-01-30 22:58:40 +01:00
parent 401e7a9edb
commit 7c2b5f116d

View File

@@ -24,13 +24,17 @@ int mainTestDevices(int argc, const char* argv[])
fmt::print("Detected {} devices:\n", candidates.size());
}
fmt::print("{:15} {:30} {}\n", "Type", "Serial number", "Port (if any)");
for (auto& candidate : candidates)
if (!candidates.empty())
{
fmt::print("{:15} {:30} {}\n",
getDeviceName(candidate->type),
candidate->serial,
candidate->serialPort);
fmt::print(
"{:15} {:30} {}\n", "Type", "Serial number", "Port (if any)");
for (auto& candidate : candidates)
{
fmt::print("{:15} {:30} {}\n",
getDeviceName(candidate->type),
candidate->serial,
candidate->serialPort);
}
}
return 0;