--- stdinhand.c.orig Fri Jul 28 09:31:53 2000 +++ stdinhand.c Fri Jul 28 10:40:22 2000 @@ -3121,6 +3121,13 @@ } /************************************************************************** +Additional 'help' options +**************************************************************************/ +char *help_general_options[] = { + "commands", "options", NULL +}; + +/************************************************************************** ... **************************************************************************/ static char *help_generator(char *text, int state) @@ -3138,7 +3145,7 @@ } /* Return the next name which partially matches from the command list. */ - if (try_commands) { + if (try_commands > 0) { while (list_index < CMD_NUM) { name = commands[list_index].name; list_index++; @@ -3157,6 +3164,19 @@ if (mystrncasecmp (name, text, len) == 0) return mystrdup(name); + } + try_commands = -1; + list_index = 0; + } + + if (try_commands < 0) { + /* Return the 'commands' or 'options' which partially matches. */ + while ((name = help_general_options[list_index])) { + list_index++; + + if (mystrncasecmp (name, text, len) == 0) { + return mystrdup(name); + } } }