From 9112d97efb26866e1bded7d52884398711eed653 Mon Sep 17 00:00:00 2001 From: Ryan Waskiewicz Date: Tue, 26 Aug 2025 18:25:26 -0400 Subject: Add index column to `bt_list` command This commit adds an 'index' field to the output of the `bt_list` command. This is meant to be used with/for `bt_forget `, which requires an index of the device to forget - this helps clarify the index of each device. --- src/tangara/app_console/app_console.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tangara/app_console/app_console.cpp b/src/tangara/app_console/app_console.cpp index dcefc966..711f3d68 100644 --- a/src/tangara/app_console/app_console.cpp +++ b/src/tangara/app_console/app_console.cpp @@ -470,8 +470,10 @@ int CmdBtList(int argc, char** argv) { } AppConsole::sServices->bluetooth().pairedDevice(devices[index]); } else { - std::cout << "mac\t\tname" << std::endl; + std::cout << "index\tmac\t\tname" << std::endl; + auto idx = 0; for (const auto& device : devices) { + std::cout << std::setfill(' ') << std::setw(5) << idx++ << "\t"; for (size_t i = 0; i < device.mac.size(); i++) { std::cout << std::hex << std::setfill('0') << std::setw(2) << static_cast(device.mac[i]); -- cgit v1.2.3