diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-21 11:33:35 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-23 08:31:16 +0100 |
commit | 73ac8b16486fa96ec2745da7020379e6442f7c7a (patch) | |
tree | b912200408915bbcca65b99fbcd6843fa33c4fdb | |
parent | b01bba2f2beac5312206b84b879a0ec3c277e7fb (diff) | |
download | barebox-73ac8b16486fa96ec2745da7020379e6442f7c7a.tar.gz barebox-73ac8b16486fa96ec2745da7020379e6442f7c7a.tar.xz |
bbu: Emit a message about what happens also when -y is given
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>
Link: https://lore.barebox.org/20240221103334.1925850-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/bbu.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/common/bbu.c b/common/bbu.c index f08ce7e0d5..ba2566acdf 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -95,17 +95,23 @@ out: int bbu_confirm(struct bbu_data *data) { int key; + const char *prompt; if (data->flags & BBU_FLAG_YES) - return 0; + prompt = "."; + else + prompt = " (y/n)?"; if (data->imagefile) - printf("update barebox from %s using handler %s to %s (y/n)?\n", - data->imagefile, data->handler_name, - data->devicefile); + 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 (y/n)?\n", - data->devicefile, data->handler_name); + printf("Refresh barebox on %s using handler %s%s\n", + data->devicefile, data->handler_name, prompt); + + if (data->flags & BBU_FLAG_YES) + return 0; key = read_key(); |