Diff for /libaitio/src/Attic/cli.c between versions 1.1.2.3 and 1.1.2.4

version 1.1.2.3, 2010/03/11 00:17:52 version 1.1.2.4, 2010/03/11 13:29:56
Line 90  char *io_Comp_Filename(const char *text, int state) Line 90  char *io_Comp_Filename(const char *text, int state)
 #pragma GCC visibility push(hidden)  #pragma GCC visibility push(hidden)
   
 ioCommands_t io_stdCmds[] = {  ioCommands_t io_stdCmds[] = {
        { "test", io_Cmd_Unsupported, "Test - Don`t use default command structure!", "test <cr>", NULL },         { "test", io_Cmd_Unsupported, "Test - Don`t use default command structure!", "test <cr>", io_Comp_Filename }, 
         { "-------", NULL, "---------------------", NULL, NULL },           { "-------", NULL, "---------------------", NULL, NULL }, 
         { "help", io_Cmd_Help, "Help screen", "help [command] <cr>", NULL },           { "help", io_Cmd_Help, "Help screen", "help [command] <cr>", NULL }, 
         { "exit", io_Cmd_Exit, "Exit from console", "exit <cr>", NULL },           { "exit", io_Cmd_Exit, "Exit from console", "exit <cr>", NULL }, 
Line 144  int ioCLIExec(ioCommands_t *cmdList, FILE *out, const  Line 144  int ioCLIExec(ioCommands_t *cmdList, FILE *out, const 
                 {                  {
                         int len = strlen(text);                          int len = strlen(text);
   
                        for (i = state; cmdList[i].cmd_name; i++)                        for (i = state; cmdList[i].cmd_name; i++) {
                                 if (strncmp(cmdList[i].cmd_name, "---", 3) &&                                   if (strncmp(cmdList[i].cmd_name, "---", 3) && 
                                                 !strncmp(cmdList[i].cmd_name, text, len))                                                  !strncmp(cmdList[i].cmd_name, text, len))
                                         return strdup(cmdList[i].cmd_name);                                          return strdup(cmdList[i].cmd_name);
                           }
   
                         return NULL;                          return NULL;
                 }                  }
Line 155  int ioCLIExec(ioCommands_t *cmdList, FILE *out, const  Line 156  int ioCLIExec(ioCommands_t *cmdList, FILE *out, const 
                 if (!start)                  if (!start)
                         matches = rl_completion_matches(text, cmdCompGet);                          matches = rl_completion_matches(text, cmdCompGet);
                 else                  else
                        for (i = 0; cmdList[i].cmd_name; i++)                        for (i = 0; cmdList[i].cmd_name; i++) {
                                if (cmdList[i].cmd_comp && !strncmp(rl_line_buffer,                                 if (!cmdList[i].cmd_comp)
                                                        cmdList[i].cmd_name, strlen(cmdList[i].cmd_name)))                                        continue;
                                 if (!strncmp(rl_line_buffer, cmdList[i].cmd_name, strlen(cmdList[i].cmd_name)))
                                         matches = rl_completion_matches(text, cmdList[i].cmd_comp);                                          matches = rl_completion_matches(text, cmdList[i].cmd_comp);
                           }
   
                 return matches;                  return matches;
         }          }

Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>