shell_parse.c 604 B

1234567891011121314151617181920212223
  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 clish_shell_parse(
  9. const clish_shell_t * this, const char *line,
  10. const clish_command_t ** cmd, clish_pargv_t ** pargv)
  11. {
  12. clish_pargv_status_t result = CLISH_BAD_CMD;
  13. *cmd = clish_shell_resolve_command(this, line);
  14. /* Now construct the parameters for the command */
  15. if (NULL != *cmd)
  16. *pargv = clish_pargv_new(*cmd, line, 0, &result);
  17. return result;
  18. }
  19. /*----------------------------------------------------------- */