{
/* If we found an alias, we must return the aliased
command. */
- return p->alias_target ? p->alias_target : p;
+ return p->is_alias () ? p->alias_target : p;
}
q = lookup_cmd_with_subcommands (subcommands, *(p->subcommands));
do_prefix_cmd (const char *args, int from_tty, struct cmd_list_element *c)
{
/* Look past all aliases. */
- while (c->alias_target != nullptr)
+ while (c->is_alias ())
c = c->alias_target;
help_list (*c->subcommands, c->prefixname ().c_str (),
/* If this command was an alias, remove it from the list of
aliases. */
- if (iter->alias_target)
+ if (iter->is_alias ())
{
struct cmd_list_element **prevp = &iter->alias_target->aliases;
struct cmd_list_element *a = *prevp;
fput_alias_definition_styled (struct cmd_list_element *c,
struct ui_file *stream)
{
- gdb_assert (c->alias_target != nullptr);
+ gdb_assert (c->is_alias ());
fputs_filtered (" alias ", stream);
fput_command_name_styled (c, stream);
fprintf_filtered (stream, " = ");
/* Walk through the commands. */
for (c=commandlist;c;c=c->next)
{
- if (c->alias_target != nullptr)
+ if (c->is_alias ())
{
/* Command aliases/abbreviations are skipped to ensure we print the
doc of a command only once, when encountering the aliased
continue;
}
- if (c->alias_target != nullptr && theclass != class_alias)
+ if (c->is_alias () && theclass != class_alias)
{
/* Do not show an alias, unless specifically showing the
list of aliases: for all other classes, an alias is
list of sub-commands of the aliased command. */
print_help_for_command
(c,
- recurse && (theclass != class_alias || c->alias_target == nullptr),
+ recurse && (theclass != class_alias || !c->is_alias ()),
stream);
continue;
}
*text += len;
- if (found->alias_target)
+ if (found->is_alias ())
{
/* We drop the alias (abbreviation) in favor of the command it
is pointing to. If the alias is deprecated, though, we need to
return 0;
else
{
- if ((*cmd)->alias_target)
+ if ((*cmd)->is_alias ())
{
/* If the command was actually an alias, we note that an
alias was used (by assigning *ALIAS) and we set *CMD. */
/* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */
- if (list->subcommands && list->alias_target == nullptr)
+ if (list->subcommands && !list->is_alias ())
{
ui_out_emit_tuple optionlist_emitter (uiout, "optionlist");
std::string prefixname = list->prefixname ();
uiout->field_string ("prefix", new_prefix);
cmd_show_list (*list->subcommands, from_tty);
}
- else if (list->theclass != no_set_class && list->alias_target == nullptr)
+ else if (list->theclass != no_set_class && !list->is_alias ())
{
ui_out_emit_tuple option_emitter (uiout, "option");