mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 01:35:35 +03:00
CLI: give help when trying to set invalid value
This commit is contained in:
parent
744e2a857f
commit
ea34fa4366
1 changed files with 8 additions and 1 deletions
|
@ -2308,6 +2308,11 @@ static void cliPrintVar(const clivalue_t *var, uint32_t full)
|
||||||
break;
|
break;
|
||||||
case MODE_LOOKUP:
|
case MODE_LOOKUP:
|
||||||
cliPrintf(lookupTables[var->config.lookup.tableIndex].values[value]);
|
cliPrintf(lookupTables[var->config.lookup.tableIndex].values[value]);
|
||||||
|
if (full) {
|
||||||
|
for (int i=0; i<lookupTables[var->config.lookup.tableIndex].valueCount; i++) {
|
||||||
|
cliPrintf(" %s", lookupTables[var->config.lookup.tableIndex].values[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2426,7 +2431,9 @@ static void cliSet(char *cmdline)
|
||||||
cliPrintf("%s set to ", valueTable[i].name);
|
cliPrintf("%s set to ", valueTable[i].name);
|
||||||
cliPrintVar(val, 0);
|
cliPrintVar(val, 0);
|
||||||
} else {
|
} else {
|
||||||
cliPrint("Invalid value\r\n");
|
cliPrint("Invalid value. Allowed values are: ");
|
||||||
|
cliPrintVar(val, 1); // print out min/max/table values
|
||||||
|
cliPrint("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue