Lines Matching refs:main_cmds
58 struct cmdnames main_cmds, other_cmds; in help_unknown_cmd() local
60 memset(&main_cmds, 0, sizeof(main_cmds)); in help_unknown_cmd()
61 memset(&other_cmds, 0, sizeof(main_cmds)); in help_unknown_cmd()
65 load_command_list("perf-", &main_cmds, &other_cmds); in help_unknown_cmd()
67 if (add_cmd_list(&main_cmds, &other_cmds) < 0) { in help_unknown_cmd()
71 qsort(main_cmds.names, main_cmds.cnt, in help_unknown_cmd()
72 sizeof(main_cmds.names), cmdname_compare); in help_unknown_cmd()
73 uniq(&main_cmds); in help_unknown_cmd()
75 if (main_cmds.cnt) { in help_unknown_cmd()
77 for (i = 0; i < main_cmds.cnt; ++i) in help_unknown_cmd()
78 main_cmds.names[i]->len = in help_unknown_cmd()
79 levenshtein(cmd, main_cmds.names[i]->name, 0, 2, 1, 4); in help_unknown_cmd()
81 qsort(main_cmds.names, main_cmds.cnt, in help_unknown_cmd()
82 sizeof(*main_cmds.names), levenshtein_compare); in help_unknown_cmd()
84 best_similarity = main_cmds.names[0]->len; in help_unknown_cmd()
86 while (n < main_cmds.cnt && best_similarity == main_cmds.names[n]->len) in help_unknown_cmd()
91 const char *assumed = main_cmds.names[0]->name; in help_unknown_cmd()
93 main_cmds.names[0] = NULL; in help_unknown_cmd()
94 clean_cmdnames(&main_cmds); in help_unknown_cmd()
109 if (main_cmds.cnt && best_similarity < 6) { in help_unknown_cmd()
114 fprintf(stderr, "\t%s\n", main_cmds.names[i]->name); in help_unknown_cmd()