mirror of
https://xff.cz/git/u-boot/
synced 2025-08-31 16:22:36 +02:00
hush: Add rudimentary support for PS1 and PS2
Add trivial support for changing the U-Boot command prompt string by setting PS1 and PS2 environment variables. Only static variables are supported. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -978,12 +978,22 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str)
|
||||
static int uboot_cli_readline(struct in_str *i)
|
||||
{
|
||||
char *prompt;
|
||||
char __maybe_unused *ps_prompt = NULL;
|
||||
|
||||
if (i->promptmode == 1)
|
||||
prompt = CONFIG_SYS_PROMPT;
|
||||
else
|
||||
prompt = CONFIG_SYS_PROMPT_HUSH_PS2;
|
||||
|
||||
#ifdef CONFIG_CMDLINE_PS_SUPPORT
|
||||
if (i->promptmode == 1)
|
||||
ps_prompt = getenv("PS1");
|
||||
else
|
||||
ps_prompt = getenv("PS2");
|
||||
if (ps_prompt)
|
||||
prompt = ps_prompt;
|
||||
#endif
|
||||
|
||||
return cli_readline(prompt);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user