From fd1be9849cb72808d7cb8369c1884fc1077e617b Mon Sep 17 00:00:00 2001 From: Yong Cong Sin Date: Fri, 23 Aug 2024 16:55:28 +0800 Subject: [PATCH] shell: shell_help: fix width for subcommands help text The terminal offset for subcommands' help text isn't computed correctly, fix it. Signed-off-by: Yong Cong Sin Signed-off-by: Yong Cong Sin --- subsys/shell/shell_help.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/shell/shell_help.c b/subsys/shell/shell_help.c index 235e2111032..95419dba101 100644 --- a/subsys/shell/shell_help.c +++ b/subsys/shell/shell_help.c @@ -110,7 +110,8 @@ static void help_item_print(const struct shell *sh, const char *item_name, uint16_t item_name_width, const char *item_help) { static const uint8_t tabulator[] = " "; - const uint16_t offset = 2 * strlen(tabulator) + item_name_width + 1; + static const char sub_cmd_sep[] = ": "; /* subcommands separator */ + const uint16_t offset = 2 * strlen(tabulator) + item_name_width + strlen(sub_cmd_sep); if ((item_name == NULL) || (item_name[0] == '\0')) { return;