]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * (C) Copyright 2014-2016 Leo C. <erbl259-lmu@yahoo.de> | |
3 | * | |
4 | * (C) Copyright 2014 Google, Inc | |
5 | * Simon Glass <sjg@chromium.org> | |
6 | * | |
7 | * SPDX-License-Identifier: GPL-2.0 | |
8 | */ | |
9 | ||
10 | #ifndef CLI_READLINE_H | |
11 | #define CLI_READLINE_H | |
12 | ||
13 | #include "common.h" | |
14 | #include <stdbool.h> | |
15 | ||
16 | extern char console_buffer[]; /* console I/O buffer */ | |
17 | ||
18 | /** | |
19 | * cli_readline() - read a line into the console_buffer | |
20 | * | |
21 | * Display the prompt, then read a command line into console_buffer. The | |
22 | * maximum line length is CONFIG_SYS_CBSIZE including a \0 terminator, which | |
23 | * will always be added. | |
24 | * | |
25 | * The command is echoed as it is typed. Command editing is supported. | |
26 | * Tab auto-complete is supported if CONFIG_AUTO_COMPLETE is defined. | |
27 | * | |
28 | * @prompt: Prompt to display | |
29 | * @enable_history: Use history buffer if true | |
30 | * @return command line length excluding terminator, or -ve on error | |
31 | */ | |
32 | int cli_readline(const FLASH char *const prompt, bool enable_history); | |
33 | ||
34 | #endif /* CLI_READLINE_H */ |