| 852 | |
| 853 | #ifdef FINSH_USING_OPTION_COMPLETION |
| 854 | static msh_cmd_opt_t *msh_get_cmd_opt(char *opt_str) |
| 855 | { |
| 856 | struct finsh_syscall *index; |
| 857 | msh_cmd_opt_t *opt = RT_NULL; |
| 858 | char *ptr; |
| 859 | int len; |
| 860 | |
| 861 | ptr = strchr(opt_str, ' '); |
| 862 | if (ptr) |
| 863 | { |
| 864 | len = ptr - opt_str; |
| 865 | } |
| 866 | else |
| 867 | { |
| 868 | len = strlen(opt_str); |
| 869 | } |
| 870 | #if defined(FINSH_USING_SYMTAB) |
| 871 | for (index = _syscall_table_begin; |
| 872 | index < _syscall_table_end; |
| 873 | FINSH_NEXT_SYSCALL(index)) |
| 874 | { |
| 875 | if (strncmp(index->name, opt_str, len) == 0 && index->name[len] == '\0') |
| 876 | { |
| 877 | opt = index->opt; |
| 878 | break; |
| 879 | } |
| 880 | } |
| 881 | #endif /* FINSH_USING_SYMTAB */ |
| 882 | return opt; |
| 883 | } |
| 884 | |
| 885 | static int msh_get_argc(char *prefix, char **last_argv) |
| 886 | { |
no outgoing calls
no test coverage detected