shell: Include the command help when listing all commands

Most commands provide a short string to describe the parameters it
takes. Provide this help text as part of the list of supported
commands for each module.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-14 14:13:27 +02:00 committed by Johan Hedberg
commit c87ecf58de

View file

@ -216,7 +216,10 @@ static void print_module_commands(const int module)
printk("help\n"); printk("help\n");
for (i = 0; shell_module->commands[i].cmd_name; i++) { for (i = 0; shell_module->commands[i].cmd_name; i++) {
printk("%s\n", shell_module->commands[i].cmd_name); printk("%-28s %s\n",
shell_module->commands[i].cmd_name,
shell_module->commands[i].help ?
shell_module->commands[i].help : "");
} }
} }