Commit 46d9ba4c authored by Zachary T Welch's avatar Zachary T Welch
Browse files

add help regardless of callback

Add help for commands regardless of whether a handler is involved.
With this, all sorts of new commands can be found in 'help' text.
Hopefully, all of them have been documented....

Sadly, the lsort function appears to handle nested lists poorly, such
that sub-commands do not group with their parents.
parent a1a3ee57
...@@ -237,6 +237,8 @@ command_t* register_command(command_context_t *context, command_t *parent, char ...@@ -237,6 +237,8 @@ command_t* register_command(command_context_t *context, command_t *parent, char
} }
} }
command_helptext_add(command_name_list(c), help);
/* just a placeholder, no handler */ /* just a placeholder, no handler */
if (c->handler == NULL) if (c->handler == NULL)
return c; return c;
...@@ -257,8 +259,6 @@ command_t* register_command(command_context_t *context, command_t *parent, char ...@@ -257,8 +259,6 @@ command_t* register_command(command_context_t *context, command_t *parent, char
free((void *)full_name); free((void *)full_name);
command_helptext_add(command_name_list(c), help);
return c; return c;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment