diff options
| author | Quentin Schulz <[email protected]> | 2025-12-18 12:44:41 +0100 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2025-12-24 09:17:21 +0100 |
| commit | de3754fea3c0d76a854f3cd2f87fd0c39ad3043f (patch) | |
| tree | aa28ff5bff7b45fff63358c48a7152ecfbc522b4 | |
| parent | 00bc1adae41df4b7d668f61b64d4898b4adb342a (diff) | |
cmd: bdinfo: provide long help with all options
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 <[email protected]>
Signed-off-by: Quentin Schulz <[email protected]>
| -rw-r--r-- | cmd/bdinfo.c | 16 | ||||
| -rw-r--r-- | test/cmd/bdinfo.c | 11 |
2 files changed, 26 insertions, 1 deletions
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 8e2bbfa9c20..43f425c7609 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -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 ); diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c index 3005c85d4a0..892f2e34d89 100644 --- a/test/cmd/bdinfo.c +++ b/test/cmd/bdinfo.c @@ -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(); |
