]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: bdinfo: provide long help with all options
authorQuentin Schulz <quentin.schulz@cherry.de>
Thu, 18 Dec 2025 11:44:41 +0000 (12:44 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 24 Dec 2025 08:17:21 +0000 (09:17 +0100)
Document the bdinfo -a, -e and -m options in the long help, but only
when they can be used. The string concatenation is a bit odd with two
newlines, but it does render properly once in U-Boot CLI.

Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
cmd/bdinfo.c
test/cmd/bdinfo.c

index 8e2bbfa9c20cf8d18940bbcd09a45e5529ed2623..43f425c7609b64cbca54206c2af3088ab4a19a63 100644 (file)
@@ -213,5 +213,19 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 U_BOOT_CMD(
        bdinfo, 2,      1,      do_bdinfo,
        "print Board Info structure",
-       ""
+// Long help prepended with command's name, and `bdinfo` is a valid command
+       "\n"
+#if CONFIG_IS_ENABLED(GETOPT)
+       "bdinfo -a\n"
+#endif
+       "  - print all Board Info structure"
+#if CONFIG_IS_ENABLED(GETOPT)
+       "\n"
+#if IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP)
+       "bdinfo -e\n"
+       "  - print Board Info related to network\n"
+#endif
+       "bdinfo -m\n"
+       "  - print Board Info related to DRAM"
+#endif
 );
index 3005c85d4a0b31911bc04903dd3028f38e13cafd..892f2e34d89f95f223872056a3c0e351af6bf2f6 100644 (file)
@@ -310,6 +310,17 @@ static int bdinfo_test_help(struct unit_test_state *uts)
                ut_assert_nextline_empty();
                ut_assert_nextlinen("Usage:");
                ut_assert_nextlinen("bdinfo");
+               if (CONFIG_IS_ENABLED(GETOPT))
+                       ut_assert_nextlinen("bdinfo -a");
+               ut_assert_nextlinen("  - print all Board Info structure");
+               if (CONFIG_IS_ENABLED(GETOPT)) {
+                       if (IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP)) {
+                               ut_assert_nextlinen("bdinfo -e");
+                               ut_assert_nextlinen("  - print Board Info related to network");
+                       }
+                       ut_assert_nextlinen("bdinfo -m");
+                       ut_assert_nextlinen("  - print Board Info related to DRAM");
+               }
        }
        ut_assert_console_end();