aboutsummaryrefslogtreecommitdiff
path: root/util/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/readline.c')
-rw-r--r--util/readline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/readline.c b/util/readline.c
index f1ac6e4769..494a3d924e 100644
--- a/util/readline.c
+++ b/util/readline.c
@@ -286,6 +286,14 @@ void readline_add_completion(ReadLineState *rs, const char *str)
}
}
+void readline_add_completion_of(ReadLineState *rs,
+ const char *pfx, const char *str)
+{
+ if (!strncmp(str, pfx, strlen(pfx))) {
+ readline_add_completion(rs, str);
+ }
+}
+
void readline_set_completion_index(ReadLineState *rs, int index)
{
rs->completion_index = index;