mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
gdb: add cmd_list_element::is_command_class_help
Same idea as the previous patches, but for whether a command is a "command class help" command. I think this one is particularly useful, because it's not obvious when reading code what "c->func == NULL" means. Remove the cmd_func_p function, which does kind of the same thing as cmd_list_element::is_command_class_help (except it doesn't give a clue about the semantic of a NULL func value). gdb/ChangeLog: * cli/cli-decode.h (cmd_list_element) <is_command_class_help>: New, use it. * command.h (cmd_func_p): Remove. * cli/cli-decode.c (cmd_func_p): Remove. Change-Id: I521a3e1896dc93a5babe1493d18f5eb071e1b3b7
This commit is contained in:
@@ -87,6 +87,12 @@ struct cmd_list_element
|
||||
bool is_prefix () const
|
||||
{ return this->subcommands != nullptr; }
|
||||
|
||||
/* Return true if this command is a "command class help" command. For
|
||||
instance, a "stack" dummy command is registered so that one can do
|
||||
"help stack" and show help for all commands of the "stack" class. */
|
||||
bool is_command_class_help () const
|
||||
{ return this->func == nullptr; }
|
||||
|
||||
/* Points to next command in this list. */
|
||||
struct cmd_list_element *next = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user