iocsh: tab completion handle iocshArgArgv

This commit is contained in:
Michael Davidsaver
2023-03-12 09:03:26 +00:00
parent 8f1243da40
commit 0c13e6ba6c
+11 -1
View File
@@ -559,7 +559,17 @@ char** iocsh_attempt_completion(const char* word, int start, int end)
break;
}
}
err = arg-1u >= size_t(def->pFuncDef->nargs);
if(arg-1u >= size_t(def->pFuncDef->nargs)) {
if(def->pFuncDef->arg
&& def->pFuncDef->nargs
&& def->pFuncDef->arg[def->pFuncDef->nargs-1u]->type == iocshArgArgv)
{
// last argument is variable length
arg = def->pFuncDef->nargs;
} else {
err = true;
}
}
}
if(!err) {