aboutsummaryrefslogtreecommitdiffstats
path: root/common/cli_readline.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-10-01 19:13:16 -0600
committerTom Rini <trini@konsulko.com>2023-10-11 15:43:54 -0400
commit3b487bf51115bfb9a0f85667a5608fc57788107c (patch)
tree80ca6787a758e941d80184f184221945106f719d /common/cli_readline.c
parent8fc041fe4c34bb6108444ee9970151f43add0ce9 (diff)
downloadu-boot-3b487bf51115bfb9a0f85667a5608fc57788107c.tar.gz
cli: Allow command completion to be disabled
When inputting text outside the command line we don't want to use tab for command completion. Add an option to control this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cli_readline.c')
-rw-r--r--common/cli_readline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/cli_readline.c b/common/cli_readline.c
index fa8f525d3a4..23913a857a9 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -389,7 +389,7 @@ int cread_line_process_ch(struct cli_line_state *cls, char ichar)
}
break;
case '\t':
- if (IS_ENABLED(CONFIG_AUTO_COMPLETE)) {
+ if (IS_ENABLED(CONFIG_AUTO_COMPLETE) && cls->cmd_complete) {
int num2, col;
/* do not autocomplete when in the middle */
@@ -440,6 +440,7 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len,
cls->prompt = prompt;
cls->buf = buf;
cls->history = true;
+ cls->cmd_complete = true;
if (init_len)
cread_add_str(buf, init_len, 1, &cls->num, &cls->eol_num, buf,