shell_parse.c 609 B

123456789101112131415161718192021222324
  1. /*
  2. * shell_parse.c
  3. */
  4. #include "private.h"
  5. #include "lub/string.h"
  6. #include <string.h>
  7. /*----------------------------------------------------------- */
  8. clish_pargv_status_t
  9. clish_shell_parse(const clish_shell_t * this,
  10. const char *line,
  11. const clish_command_t ** cmd, clish_pargv_t ** pargv)
  12. {
  13. clish_pargv_status_t result = CLISH_BAD_CMD;
  14. *cmd = clish_shell_resolve_command(this, line);
  15. /* Now construct the parameters for the command */
  16. if (NULL != *cmd)
  17. *pargv = clish_pargv_new(*cmd, line, 0, &result);
  18. return result;
  19. }
  20. /*----------------------------------------------------------- */