Lines Matching defs:main_cmds
163 struct cmdnames *main_cmds,
170 list_commands_in_dir(main_cmds, exec_path, prefix);
171 qsort(main_cmds->names, main_cmds->cnt,
172 sizeof(*main_cmds->names), cmdname_compare);
173 uniq(main_cmds);
195 exclude_cmds(other_cmds, main_cmds);
198 void list_commands(const char *title, struct cmdnames *main_cmds,
203 for (i = 0; i < main_cmds->cnt; i++)
204 if (longest < main_cmds->names[i]->len)
205 longest = main_cmds->names[i]->len;
210 if (main_cmds->cnt) {
216 pretty_print_string_list(main_cmds, longest);
279 struct cmdnames main_cmds, other_cmds;
281 memset(&main_cmds, 0, sizeof(main_cmds));
282 memset(&other_cmds, 0, sizeof(main_cmds));
287 load_command_list("perf-", &main_cmds, &other_cmds);
289 add_cmd_list(&main_cmds, &aliases);
290 add_cmd_list(&main_cmds, &other_cmds);
291 qsort(main_cmds.names, main_cmds.cnt,
292 sizeof(main_cmds.names), cmdname_compare);
293 uniq(&main_cmds);
295 if (main_cmds.cnt) {
297 for (i = 0; i < main_cmds.cnt; ++i)
298 main_cmds.names[i]->len =
299 levenshtein(cmd, main_cmds.names[i]->name, 0, 2, 1, 4);
301 qsort(main_cmds.names, main_cmds.cnt,
302 sizeof(*main_cmds.names), levenshtein_compare);
304 best_similarity = main_cmds.names[0]->len;
306 while (n < main_cmds.cnt && best_similarity == main_cmds.names[n]->len)
311 const char *assumed = main_cmds.names[0]->name;
313 main_cmds.names[0] = NULL;
314 clean_cmdnames(&main_cmds);
329 if (main_cmds.cnt && best_similarity < 6) {
334 fprintf(stderr, "\t%s\n", main_cmds.names[i]->name);