Commit 422657bc authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Anas Nashif
Browse files

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: default avatarYong Cong Sin <ycsin@meta.com>
Signed-off-by: default avatarYong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit fd1be984)
parent 480fa71c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;