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