Skip to content

Commit 08e35db

Browse files
committed
Show help cmd description for custom/builtin help
1 parent 6eaf080 commit 08e35db

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/minbasecli.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,19 @@ void MINBASECLI::cmd_help(int argc, char* argv[])
387387
return;
388388

389389
// Shows each added command descriptions
390-
this->printf("Available commands:\n\n");
390+
this->printf("\nAvailable commands:\n\n");
391+
392+
// Shows help description info
393+
if (use_builtin_help_cmd)
394+
this->printf("%s - %s\n", CMD_HELP, CMD_HELP_DESCRIPTION);
395+
396+
// Shows all added command descriptions
391397
for (uint8_t i = 0U; i < num_added_commands; i++)
392398
{
393399
this->printf("%s - %s\n", added_commands[i].command,
394400
added_commands[i].description);
395401
}
402+
396403
this->printf("\n");
397404
}
398405

src/minbasecli.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class MINBASECLI : public MINBASECLI_HAL
241241
/**
242242
* @brief Builtin command "help" description text.
243243
*/
244-
static constexpr char CMD_HELP_DESCRIPTION[] = "Shows current info.\n";
244+
static constexpr char CMD_HELP_DESCRIPTION[] = "Shows current info.";
245245

246246
/**
247247
* @brief CLI initialized flag.

0 commit comments

Comments
 (0)