1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Change CLI "get" to be case-insensitive (#5382)

Matches the behavior of the "set" command.
This commit is contained in:
etracer65 2018-03-08 12:50:31 -05:00 committed by Michael Keller
parent 4d3666b77b
commit f97df6827e

View file

@ -208,6 +208,16 @@ static const char * const *sensorHardwareNames[] = {
};
#endif // USE_SENSOR_NAMES
static char *cliStringToLowercase(char *str)
{
char *s = str;
while (*s) {
*s = tolower((unsigned char)*s);
s++;
}
return str;
}
static void cliPrint(const char *str)
{
while (*str) {
@ -2828,7 +2838,7 @@ STATIC_UNIT_TESTED void cliGet(char *cmdline)
int matchedCommands = 0;
for (uint32_t i = 0; i < valueTableEntryCount; i++) {
if (strstr(valueTable[i].name, cmdline)) {
if (strstr(valueTable[i].name, cliStringToLowercase(cmdline))) {
val = &valueTable[i];
cliPrintf("%s = ", valueTable[i].name);
cliPrintVar(val, 0);