From ace21957447369d273622e8869f1183549cded3d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 20 Nov 2012 21:02:36 +0000 Subject: gdb: include help aliases in help command completion There are a bunch of aliases that get used with help, but the current command completion logic does not include those when doing completions. Since the framework is already mostly in place, extend complete_on_cmdlist slightly to pass down the ignore_help_classes flag like is done with the existing lookup command logic. Now you can do: (gdb) help use and get back: (gdb) help user-defined Signed-off-by: Mike Frysinger --- gdb/cli/cli-decode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/cli/cli-decode.c') diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 6e0f0de..3de01d5 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1726,7 +1726,8 @@ lookup_cmd_composition (char *text, "oobar"; if WORD is "baz/foo", return "baz/foobar". */ VEC (char_ptr) * -complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word) +complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word, + int ignore_help_classes) { struct cmd_list_element *ptr; VEC (char_ptr) *matchlist = NULL; @@ -1743,7 +1744,7 @@ complete_on_cmdlist (struct cmd_list_element *list, char *text, char *word) for (ptr = list; ptr; ptr = ptr->next) if (!strncmp (ptr->name, text, textlen) && !ptr->abbrev_flag - && (ptr->func + && (!ignore_help_classes || ptr->func || ptr->prefixlist)) { char *match; -- cgit v1.1