1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Fixed display of CLI lookup options. (#5493)

This commit is contained in:
Michael Keller 2018-03-22 19:40:49 +13:00 committed by Andrey Mironov
parent 4786e1a333
commit 5dc23e662f

View file

@ -488,13 +488,15 @@ static void cliPrintVarRange(const clivalue_t *var)
break;
case (MODE_LOOKUP): {
const lookupTableEntry_t *tableEntry = &lookupTables[var->config.lookup.tableIndex];
cliPrint("Allowed values:");
for (uint32_t i = 0; i < tableEntry->valueCount; i++) {
cliPrint("Allowed values: ");
bool firstEntry = true;
for (unsigned i = 0; i < tableEntry->valueCount; i++) {
if (tableEntry->values[i]) {
cliPrintf(" %s", tableEntry->values[i]);
if (i + 1 < tableEntry->valueCount) {
cliPrint(",");
if (!firstEntry) {
cliPrint(", ");
}
cliPrintf("%s", tableEntry->values[i]);
firstEntry = false;
}
}
cliPrintLinefeed();