Lines Matching refs:main_cmds
55 const char *help_unknown_cmd(const char *cmd, struct cmdnames *main_cmds) in help_unknown_cmd() argument
64 load_command_list("perf-", main_cmds, &other_cmds); in help_unknown_cmd()
66 if (add_cmd_list(main_cmds, &other_cmds) < 0) { in help_unknown_cmd()
70 qsort(main_cmds->names, main_cmds->cnt, in help_unknown_cmd()
71 sizeof(main_cmds->names), cmdname_compare); in help_unknown_cmd()
72 uniq(main_cmds); in help_unknown_cmd()
74 if (main_cmds->cnt) { in help_unknown_cmd()
76 for (i = 0; i < main_cmds->cnt; ++i) { in help_unknown_cmd()
77 main_cmds->names[i]->len = in help_unknown_cmd()
78 levenshtein(cmd, main_cmds->names[i]->name, in help_unknown_cmd()
84 qsort(main_cmds->names, main_cmds->cnt, in help_unknown_cmd()
85 sizeof(*main_cmds->names), levenshtein_compare); in help_unknown_cmd()
87 best_similarity = main_cmds->names[0]->len; in help_unknown_cmd()
89 while (n < main_cmds->cnt && best_similarity == main_cmds->names[n]->len) in help_unknown_cmd()
94 const char *assumed = main_cmds->names[0]->name; in help_unknown_cmd()
96 main_cmds->names[0] = NULL; in help_unknown_cmd()
112 if (main_cmds->cnt && best_similarity < 6) { in help_unknown_cmd()
117 fprintf(stderr, "\t%s\n", main_cmds->names[i]->name); in help_unknown_cmd()