diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-03-28 10:19:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-03-28 10:19:59 -0400 |
commit | c68677014bace6a4b6ad20f0818e1470d049618f (patch) | |
tree | 61adc39b696282ff1fd37e264220ab7eef16db22 /tools/perf/util/help-unknown-cmd.c | |
parent | 3906a13a6b4e78fbc0def03a808f091f0dff1b44 (diff) |
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>
Diffstat (limited to 'tools/perf/util/help-unknown-cmd.c')
-rw-r--r-- | tools/perf/util/help-unknown-cmd.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c index 2821f8d77e52..34201440ac03 100644 --- a/tools/perf/util/help-unknown-cmd.c +++ b/tools/perf/util/help-unknown-cmd.c | |||
@@ -6,16 +6,12 @@ | |||
6 | #include "levenshtein.h" | 6 | #include "levenshtein.h" |
7 | 7 | ||
8 | static int autocorrect; | 8 | static int autocorrect; |
9 | static struct cmdnames aliases; | ||
10 | 9 | ||
11 | static int perf_unknown_cmd_config(const char *var, const char *value, | 10 | static int perf_unknown_cmd_config(const char *var, const char *value, |
12 | void *cb __maybe_unused) | 11 | void *cb __maybe_unused) |
13 | { | 12 | { |
14 | if (!strcmp(var, "help.autocorrect")) | 13 | if (!strcmp(var, "help.autocorrect")) |
15 | autocorrect = perf_config_int(var,value); | 14 | autocorrect = perf_config_int(var,value); |
16 | /* Also use aliases for command lookup */ | ||
17 | if (!prefixcmp(var, "alias.")) | ||
18 | add_cmdname(&aliases, var + 6, strlen(var + 6)); | ||
19 | 15 | ||
20 | return 0; | 16 | return 0; |
21 | } | 17 | } |
@@ -59,14 +55,12 @@ const char *help_unknown_cmd(const char *cmd) | |||
59 | 55 | ||
60 | memset(&main_cmds, 0, sizeof(main_cmds)); | 56 | memset(&main_cmds, 0, sizeof(main_cmds)); |
61 | memset(&other_cmds, 0, sizeof(main_cmds)); | 57 | memset(&other_cmds, 0, sizeof(main_cmds)); |
62 | memset(&aliases, 0, sizeof(aliases)); | ||
63 | 58 | ||
64 | perf_config(perf_unknown_cmd_config, NULL); | 59 | perf_config(perf_unknown_cmd_config, NULL); |
65 | 60 | ||
66 | load_command_list("perf-", &main_cmds, &other_cmds); | 61 | load_command_list("perf-", &main_cmds, &other_cmds); |
67 | 62 | ||
68 | if (add_cmd_list(&main_cmds, &aliases) < 0 || | 63 | if (add_cmd_list(&main_cmds, &other_cmds) < 0) { |
69 | add_cmd_list(&main_cmds, &other_cmds) < 0) { | ||
70 | fprintf(stderr, "ERROR: Failed to allocate command list for unknown command.\n"); | 64 | fprintf(stderr, "ERROR: Failed to allocate command list for unknown command.\n"); |
71 | goto end; | 65 | goto end; |
72 | } | 66 | } |