cli: add support for partial completion with separator character

Useful for completing long lists of possible values with common prefix

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2025-02-24 21:22:52 +01:00
parent 04ecccf3e9
commit 895b4e7caf
2 changed files with 34 additions and 2 deletions

View File

@@ -311,7 +311,10 @@ function completion(count) {
add = " ";
cat = "";
add += sprintf("%-"+len+"s", entry.name);
let name = entry.name;
if (entry.incomplete)
name += "...";
add += sprintf("%-"+len+"s", name);
str += add;
x += length(add);