summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-11 09:40:28 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-11 12:15:39 -0800
commit46d9ba4c8b675deb96ac533885500eb62b6c9909 (patch)
tree754f10f869eb8ba95a4877be8610c6758d4dee9c
parenta1a3ee579ca8485f7840c7140e4a006f83b797d2 (diff)
downloadopenocd_libswd-46d9ba4c8b675deb96ac533885500eb62b6c9909.tar.gz
openocd_libswd-46d9ba4c8b675deb96ac533885500eb62b6c9909.tar.bz2
openocd_libswd-46d9ba4c8b675deb96ac533885500eb62b6c9909.tar.xz
openocd_libswd-46d9ba4c8b675deb96ac533885500eb62b6c9909.zip
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.
-rw-r--r--src/helper/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index a4ac4af0..5ac5c301 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;
}