From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] hush: Add rudimentary support for PS1 and PS2
Date: Wed, 27 Jan 2016 07:37:22 +0100 [thread overview]
Message-ID: <56A865A2.2000209@denx.de> (raw)
In-Reply-To: <1453866475-6759-2-git-send-email-marex@denx.de>
Hello Marek,
Am 27.01.2016 um 04:47 schrieb Marek Vasut:
> 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>
> ---
> README | 8 ++++++++
> common/cli_hush.c | 10 ++++++++++
> 2 files changed, 18 insertions(+)
Nice!
Reviewed-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/README b/README
> index ece4793..8fb25c6 100644
> --- a/README
> +++ b/README
> @@ -2894,6 +2894,14 @@ CBFS (Coreboot Filesystem) support
> Enable editing and History functions for interactive
> command line input operations
>
> +- Command Line PS1/PS2 support:
> + CONFIG_CMDLINE_PS_SUPPORT
> +
> + Enable support for changing the command prompt string
> + at run-time. Only static string is supported so far.
> + The string is obtained from environment variables PS1
> + and PS2.
> +
> - Default Environment:
> CONFIG_EXTRA_ENV_SETTINGS
>
> diff --git a/common/cli_hush.c b/common/cli_hush.c
> index cbaf22e..00861e2 100644
> --- a/common/cli_hush.c
> +++ b/common/cli_hush.c
> @@ -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
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2016-01-27 6:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 3:47 [U-Boot] [PATCH 1/2] hush: Pull out U-Boot prompt display and read functionality Marek Vasut
2016-01-27 3:47 ` [U-Boot] [PATCH 2/2] hush: Add rudimentary support for PS1 and PS2 Marek Vasut
2016-01-27 6:37 ` Heiko Schocher [this message]
2016-01-27 22:53 ` Simon Glass
2016-02-08 20:46 ` [U-Boot] [U-Boot, " Tom Rini
2016-01-27 6:34 ` [U-Boot] [PATCH 1/2] hush: Pull out U-Boot prompt display and read functionality Heiko Schocher
2016-01-27 22:53 ` Simon Glass
2016-02-08 20:46 ` [U-Boot] [U-Boot, " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A865A2.2000209@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.