From: Zachary T Welch Date: Wed, 11 Nov 2009 17:40:28 +0000 (-0800) Subject: add help regardless of callback X-Git-Tag: v0.4.0-rc1~826 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=46d9ba4c8b675deb96ac533885500eb62b6c9909 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. --- diff --git a/src/helper/command.c b/src/helper/command.c index a4ac4af00d..5ac5c3015d 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -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 */ if (c->handler == NULL) return c; @@ -257,8 +259,6 @@ command_t* register_command(command_context_t *context, command_t *parent, char free((void *)full_name); - command_helptext_add(command_name_list(c), help); - return c; }