U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+uboot@0leil.net>
To: u-boot@lists.denx.de
Cc: Casey Connolly <casey.connolly@linaro.org>,
	 Tom Rini <trini@konsulko.com>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	 Andrew Goodbody <andrew.goodbody@linaro.org>,
	 Peter Robinson <pbrobinson@gmail.com>,
	 Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>,
	 Quentin Schulz <quentin.schulz@cherry.de>
Subject: [PATCH v3 2/2] cmd: ufetch: only show comma separator if there was a previous feature
Date: Tue, 05 May 2026 11:14:32 +0200	[thread overview]
Message-ID: <20260505-ufetch-net-v3-2-eee5eb9ca5ce@cherry.de> (raw)
In-Reply-To: <20260505-ufetch-net-v3-0-eee5eb9ca5ce@cherry.de>

From: Quentin Schulz <quentin.schulz@cherry.de>

Currently, if NET is disabled, the next feature to be printed will start
with a comma and a space which is not pretty. Add the comma and
whitespace only when a previous feature has already been shown.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 cmd/ufetch.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/cmd/ufetch.c b/cmd/ufetch.c
index bc5db08eee1..e7b5d773f5e 100644
--- a/cmd/ufetch.c
+++ b/cmd/ufetch.c
@@ -157,26 +157,37 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
 				printf(" (%d baud)", gd->baudrate);
 			putc('\n');
 			break;
-		case FEATURES:
+		case FEATURES: {
+			const char *sep = "";
+
 			printf("Features:" RESET " ");
-			if (IS_ENABLED(CONFIG_NET))
-				printf("Net");
-			if (IS_ENABLED(CONFIG_EFI_LOADER))
-				printf(", EFI");
-			if (IS_ENABLED(CONFIG_CMD_CAT))
-				printf(", cat :3");
+			if (IS_ENABLED(CONFIG_NET)) {
+				printf("%sNet", sep);
+				sep = ", ";
+			}
+			if (IS_ENABLED(CONFIG_EFI_LOADER)) {
+				printf("%sEFI", sep);
+				sep = ", ";
+			}
+			if (IS_ENABLED(CONFIG_CMD_CAT)) {
+				printf("%scat :3", sep);
+				sep = ", ";
+			}
 #ifdef CONFIG_ARM64
 			switch (current_el()) {
 			case 2:
-				printf(", VMs");
+				printf("%sVMs", sep);
+				sep = ", ";
 				break;
 			case 3:
-				printf(", full control!");
+				printf("%sfull control!", sep);
+				sep = ", ";
 				break;
 			}
 #endif
 			printf("\n");
 			break;
+		}
 		case RELOCATION:
 			if (gd->flags & GD_FLG_SKIP_RELOC)
 				printf("Relocated:" RESET " no\n");

-- 
2.54.0


  parent reply	other threads:[~2026-05-05  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05  9:14 [PATCH v3 0/2] cmd: ufetch: print Net feature when NET_LWIP=y, prettyfy if NET=n Quentin Schulz
2026-05-05  9:14 ` [PATCH v3 1/2] cmd: ufetch: show net feature when NET_LWIP is selected Quentin Schulz
2026-05-05  9:14 ` Quentin Schulz [this message]
2026-05-05 13:58   ` [PATCH v3 2/2] cmd: ufetch: only show comma separator if there was a previous feature Simon Glass
2026-05-05 13:47 ` [PATCH v3 0/2] cmd: ufetch: print Net feature when NET_LWIP=y, prettyfy if NET=n Casey Connolly
2026-05-05 14:14 ` Casey Connolly

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=20260505-ufetch-net-v3-2-eee5eb9ca5ce@cherry.de \
    --to=foss+uboot@0leil.net \
    --cc=andrew.goodbody@linaro.org \
    --cc=casey.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=pbrobinson@gmail.com \
    --cc=quentin.schulz@cherry.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox