improve 'help' command

Rewrites 'help' command in C, using new 'cmd_help' for display.  Adds the
built-in 'help' COMMAND_HANDLER to provide better output than the
TCL-based script command (e.g. heirarchical listing of commands).

The help string is stored in the command structure, though it conitnues
to be pushed into the Jim environment.  The current idiomatic usage
suggests the addition of a usage field as well, to provide two levels
of detail for users to consume (i.e. terse usage list, or verbose help).
This commit is contained in:
Zachary T Welch
2009-11-19 06:48:37 -08:00
parent 82449e2d60
commit 5458fef43c
3 changed files with 55 additions and 20 deletions

View File

@@ -159,6 +159,7 @@ typedef __COMMAND_HANDLER((*command_handler_t));
struct command
{
char *name;
const char *help;
struct command *parent;
struct command *children;
command_handler_t handler;