1
0

shell_resolve_prefix.c 581 B

12345678910111213141516171819202122
  1. /*
  2. * shell_resolve_prefix.c
  3. */
  4. #include "private.h"
  5. /*--------------------------------------------------------- */
  6. const clish_command_t *clish_shell_resolve_prefix(const clish_shell_t * this,
  7. const char *line)
  8. {
  9. clish_command_t *cmd, *result;
  10. /* Search the current view */
  11. result = clish_view_resolve_prefix(this->view, line, BOOL_TRUE);
  12. /* Search the global view */
  13. cmd = clish_view_resolve_prefix(this->global, line, BOOL_TRUE);
  14. result = clish_command_choose_longest(result, cmd);
  15. return result;
  16. }
  17. /*----------------------------------------------------------- */