diff options
| author | Quentin Schulz <[email protected]> | 2026-05-05 11:14:32 +0200 |
|---|---|---|
| committer | Casey Connolly <[email protected]> | 2026-05-18 11:04:14 +0200 |
| commit | 218cbc4b12615e01c034bc6da925653903c0bb2a (patch) | |
| tree | 02ff1cacb954af48f637c5ce3f49f109aac71bca /cmd | |
| parent | 53e6ccc0c10ac8b7b8808ffafaa3f3104902fe8a (diff) | |
cmd: ufetch: only show comma separator if there was a previous feature
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 <[email protected]>
Reviewed-by: Casey Connolly <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Casey Connolly <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/ufetch.c | 29 |
1 files 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"); |
