MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / msh_get_cmd_opt

Function msh_get_cmd_opt

components/finsh/msh.c:854–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

852
853#ifdef FINSH_USING_OPTION_COMPLETION
854static 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
885static int msh_get_argc(char *prefix, char **last_argv)
886{

Callers 1

msh_opt_auto_completeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected