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<tab>
and get back:
	(gdb) help user-defined

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2012-11-20 21:02:36 +00:00
parent ec6632d76b
commit ace2195744
6 changed files with 42 additions and 8 deletions

View file

@ -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;