const struct ui_help_options global_commands[] = {
{ 1, "", T_HELP_SECTION_IO }, // work with pins, input, output measurement
{ 0, "w/W", T_HELP_1_21 }, // note that pin functions need power on the buffer
{ 0, "a/A/@ x", T_HELP_COMMAND_AUX },
{ 0, "f x/F x", T_HELP_1_11 },
{ 0, "f/F", T_HELP_1_23 },
{ 0, "g x/G", T_HELP_1_12 },
{ 0, "p/P", T_HELP_1_18 },
{ 0, "v x/V x", T_HELP_1_22 },
{ 0, "v/V", T_HELP_1_10 },
Currently the help menu is hand crafted for a nice look, but results in orphan commands that were added to the firmware without a help entry.
// command configuration
const struct _global_command_struct commands[] = {
// clang-format off
{ .command="ls", .allow_hiz=true, .func=&disk_ls_handler, .help_text=0x00 }, // ls T_CMDLN_LS
{ .command="cd", .allow_hiz=true, .func=&disk_cd_handler, .help_text=0x00 }, // cd T_CMDLN_CD
{ .command="mkdir", .allow_hiz=true, .func=&disk_mkdir_handler, .help_text=0x00 }, // mkdir T_CMDLN_MKDIR
{ .command="rm", .allow_hiz=true, .func=&disk_rm_handler, .help_text=0x00 }, // rm T_CMDLN_RM
I propose adding a few additional fields to the commands struct to enforce complete listings in the help output and automate the organization under topic headings.
- Help text T_HELP_ would be moved from global_commands to commands struct
- Command examples (w/W, a/A/@ x) would move to the command struct. The reason for this is that some commands have a customized/combined display that covers multiple commands in a single line, such as Aux or poWer.
- A new field that references a topic header ID in a new array. The help would iterate over the topics ID array, looping though the command struct and printing the help for any assigned commands.
This still isn’t perfect, but it does consolidate all the help into the place where you have to tie in the command anyways.