perf tools: Remove support for command aliases
This came from 'git', but isn't documented anywhere in tools/perf/Documentation/, looks like baggage we can do without, ditch it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-e7uwkn60t4hmlnwj99ba4t2s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -6,16 +6,12 @@
|
||||
#include "levenshtein.h"
|
||||
|
||||
static int autocorrect;
|
||||
static struct cmdnames aliases;
|
||||
|
||||
static int perf_unknown_cmd_config(const char *var, const char *value,
|
||||
void *cb __maybe_unused)
|
||||
{
|
||||
if (!strcmp(var, "help.autocorrect"))
|
||||
autocorrect = perf_config_int(var,value);
|
||||
/* Also use aliases for command lookup */
|
||||
if (!prefixcmp(var, "alias."))
|
||||
add_cmdname(&aliases, var + 6, strlen(var + 6));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -59,14 +55,12 @@ const char *help_unknown_cmd(const char *cmd)
|
||||
|
||||
memset(&main_cmds, 0, sizeof(main_cmds));
|
||||
memset(&other_cmds, 0, sizeof(main_cmds));
|
||||
memset(&aliases, 0, sizeof(aliases));
|
||||
|
||||
perf_config(perf_unknown_cmd_config, NULL);
|
||||
|
||||
load_command_list("perf-", &main_cmds, &other_cmds);
|
||||
|
||||
if (add_cmd_list(&main_cmds, &aliases) < 0 ||
|
||||
add_cmd_list(&main_cmds, &other_cmds) < 0) {
|
||||
if (add_cmd_list(&main_cmds, &other_cmds) < 0) {
|
||||
fprintf(stderr, "ERROR: Failed to allocate command list for unknown command.\n");
|
||||
goto end;
|
||||
}
|
||||
|
Reference in New Issue
Block a user