mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] bbu: Emit a message about what happens also when -y is given
Date: Wed, 21 Feb 2024 11:33:35 +0100	[thread overview]
Message-ID: <20240221103334.1925850-2-u.kleine-koenig@pengutronix.de> (raw)

To inform the user which device is updated using which handler, also
emit a message with -y.

Also update the wording to make the output more similar between the
different cases.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 common/bbu.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/common/bbu.c b/common/bbu.c
index ed41c92f38ec..c34d723086fa 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -95,18 +95,24 @@ int bbu_force(struct bbu_data *data, const char *fmt, ...)
 int bbu_confirm(struct bbu_data *data)
 {
 	int key;
+	const char *prompt;
+
+	if (data->flags & BBU_FLAG_YES)
+		prompt = ".";
+	else
+		prompt = " (y/n)?";
+
+	if (data->imagefile)
+		printf("update barebox on %s from %s using handler %s%s\n",
+			data->devicefile, data->imagefile,
+			data->handler_name, prompt);
+	else
+		printf("Refresh barebox on %s using handler %s%s\n",
+			data->devicefile, data->handler_name, prompt);
 
 	if (data->flags & BBU_FLAG_YES)
 		return 0;
 
-	if (data->imagefile)
-		printf("update barebox from %s using handler %s to %s (y/n)?\n",
-			data->imagefile, data->handler_name,
-			data->devicefile);
-	else
-		printf("Refresh barebox on %s using handler %s (y/n)?\n",
-			data->devicefile, data->handler_name);
-
 	key = read_key();
 
 	if (key == 'y') {

base-commit: ed7c14536d521793199abf0597164a46ba68e8e5
-- 
2.43.0




             reply	other threads:[~2024-02-21 10:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 10:33 Uwe Kleine-König [this message]
2024-02-23  7:32 ` Sascha Hauer

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=20240221103334.1925850-2-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox