OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [cli/] [cli/] [sys_cli.c] - Diff between revs 28 and 29

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 28 Rev 29
Line 217... Line 217...
  struct cli_cmd_tab_t *cli_cmd;
  struct cli_cmd_tab_t *cli_cmd;
  unsigned int bytes_read;
  unsigned int bytes_read;
 
 
  cli_init();
  cli_init();
 
 
  PRINTF_MACRO("\r\n");
  // PRINTF_MACRO("\r\n");
 
 
  for(;;)
  for(;;)
  {
  {
    PRINTF_MACRO("%d > ", last_return_value);
    // PRINTF_MACRO("%d > ", last_return_value);
 
    PRINTF_MACRO("\r\n# > ");
 
 
    cli_argc = 0;
    cli_argc = 0;
    last_return_value = EXIT_SUCCESS;
    last_return_value = EXIT_SUCCESS;
 
 
    bytes_read = (unsigned int)read(STDIN_FILENO, (void *)in_buffer, sizeof(in_buffer));
    bytes_read = (unsigned int)read(STDIN_FILENO, (void *)in_buffer, sizeof(in_buffer));
Line 247... Line 248...
      strncpy(cmd_to_check.cmd, out_buffer, MAX_CMD_LENGTH);
      strncpy(cmd_to_check.cmd, out_buffer, MAX_CMD_LENGTH);
      cli_cmd = cli_find_command(&cmd_to_check);
      cli_cmd = cli_find_command(&cmd_to_check);
 
 
      if (cli_cmd == NULL)
      if (cli_cmd == NULL)
      {
      {
        PRINTF_MACRO("\r\n Command not found!\r\n");
        PRINTF_MACRO("\r\n! > Command not found!!!");
        last_return_value = EXIT_FAILURE;
        last_return_value = EXIT_FAILURE;
        break;
        break;
      }
      }
 
 
      if(cli_ptr == NULL)
      if(cli_ptr == NULL)
Line 267... Line 268...
 
 
          cli_ptr = strtok(NULL, " \t");
          cli_ptr = strtok(NULL, " \t");
        }
        }
      }
      }
 
 
      PRINTF_MACRO("\r\n");
      // PRINTF_MACRO("\r\n");
 
 
      last_return_value = cli_cmd->func(cli_argc, (const char **)cli_argv);
      last_return_value = cli_cmd->func(cli_argc, (const char **)cli_argv);
      break;
      break;
    }
    }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.