--- libaitcli/src/cli.c 2013/10/08 09:30:55 1.6.4.1 +++ libaitcli/src/cli.c 2013/10/08 09:38:55 1.6.4.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.6.4.1 2013/10/08 09:30:55 misho Exp $ +* $Id: cli.c,v 1.6.4.2 2013/10/08 09:38:55 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -80,8 +80,12 @@ int cli_Cmd_Help(void * __restrict cli_buffer, int idx cli_Printf(buf, "\n"); if (!args) { - SLIST_FOREACH(cmd, &buf->line_cmds, cmd_next) + SLIST_FOREACH(cmd, &buf->line_cmds, cmd_next) { + if (cmd->cmd_level != idx) + continue; + cli_Printf(buf, "%s\t\t%s\n", cmd->cmd_name, cmd->cmd_help); + } } else { if (!args[1]) cli_Printf(buf, "Help screen::\n"); @@ -90,6 +94,8 @@ int cli_Cmd_Help(void * __restrict cli_buffer, int idx return RETCODE_OK; SLIST_FOREACH(cmd, &buf->line_cmds, cmd_next) { + if (cmd->cmd_level != idx) + continue; if (args[1] && (cmd->cmd_level != idx || strcmp(args[1], cmd->cmd_name))) continue;