| 6 | static FlagGroup flags; |
| 7 | |
| 8 | int mainTestDevices(int argc, const char* argv[]) |
| 9 | { |
| 10 | flags.parseFlagsWithConfigFiles(argc, argv, {}); |
| 11 | |
| 12 | auto candidates = findUsbDevices(); |
| 13 | switch (candidates.size()) |
| 14 | { |
| 15 | case 0: |
| 16 | fmt::print("Detected no devices.\n"); |
| 17 | break; |
| 18 | |
| 19 | case 1: |
| 20 | fmt::print("Detected one device:\n"); |
| 21 | break; |
| 22 | |
| 23 | default: |
| 24 | fmt::print("Detected {} devices:\n", candidates.size()); |
| 25 | } |
| 26 | |
| 27 | if (!candidates.empty()) |
| 28 | { |
| 29 | fmt::print( |
| 30 | "{:15} {:30} {}\n", "Type", "Serial number", "Port (if any)"); |
| 31 | for (auto& candidate : candidates) |
| 32 | { |
| 33 | fmt::print("{:15} {:30} {}\n", |
| 34 | getDeviceName(candidate->type), |
| 35 | candidate->serial, |
| 36 | candidate->serialPort); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | return 0; |
| 41 | } |
nothing calls this directly
no test coverage detected