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 <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
parent
276ccd04e7
commit
fd1be9849c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue