Currently the "title" style is only used when printing command names.
The "title" name itself is probably a misnomer, but meanwhile this
patch changes the existing uses to instead use the new "command" style
for consistency.
The "title" style is not removed; see the next patch.
Reviewed-By: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
&cmdlist, suppress_notification);
}
-/* Print the prefix of C followed by name of C in title style. */
+/* Print the prefix of C followed by name of C in command style. */
static void
fput_command_name_styled (const cmd_list_element &c, struct ui_file *stream)
std::string prefixname
= c.prefix == nullptr ? "" : c.prefix->prefixname ();
- fprintf_styled (stream, title_style.style (), "%s%s",
+ fprintf_styled (stream, command_style.style (), "%s%s",
prefixname.c_str (), c.name);
}
if (cmd->cmd_deprecated)
gdb_printf (_("Warning: command '%ps' (%ps) is deprecated.\n"),
- styled_string (title_style.style (),
+ styled_string (command_style.style (),
tmp_cmd_str.c_str ()),
- styled_string (title_style.style (),
+ styled_string (command_style.style (),
tmp_alias_str.c_str ()));
else
gdb_printf (_("Warning: '%ps', an alias for the command '%ps', "
"is deprecated.\n"),
- styled_string (title_style.style (),
+ styled_string (command_style.style (),
tmp_alias_str.c_str ()),
- styled_string (title_style.style (),
+ styled_string (command_style.style (),
tmp_cmd_str.c_str ()));
}
else
gdb_printf (_("Warning: command '%ps' is deprecated.\n"),
- styled_string (title_style.style (),
+ styled_string (command_style.style (),
tmp_cmd_str.c_str ()));
/* Now display a second line indicating what the user should use instead.
replacement = cmd->replacement;
if (replacement != nullptr)
gdb_printf (_("Use '%ps'.\n\n"),
- styled_string (title_style.style (),
+ styled_string (command_style.style (),
replacement));
else
gdb_printf (_("No alternative known.\n\n"));
gdb_printf (stream, "User %scommand \"",
c->is_prefix () ? "prefix" : "");
- fprintf_styled (stream, title_style.style (), "%s%s",
+ fprintf_styled (stream, command_style.style (), "%s%s",
prefix, name);
gdb_printf (stream, "\":\n");
if (cmdlines)
"The ${address_style_expr} foreground color is: ${color}" \
"style name and style word styled using its own style in show style"
- set aliases_expr [limited_style ".*aliases.*" title]
- set breakpoints_expr [limited_style ".*breakpoints.*" title]
+ set aliases_expr [limited_style ".*aliases.*" command]
+ set breakpoints_expr [limited_style ".*breakpoints.*" command]
gdb_test "help" \
[multi_line \
"List of classes of commands:" \
"${breakpoints_expr} -- Making program stop at certain points\." \
".*" \
] \
- "help classes of commands styled with title"
+ "help classes of commands styled with command"
- set taas_expr [limited_style ".*taas.*" title]
- set tfaas_expr [limited_style ".*tfaas.*" title]
+ set taas_expr [limited_style ".*taas.*" command]
+ set tfaas_expr [limited_style ".*tfaas.*" command]
set cut_for_thre_expr [limited_style "cut for 'thre" highlight]
gdb_test "apropos -v cut for 'thre" \
[multi_line \
gdb_test_no_output "maintenance deprecate p \"new_p\"" \
"maintenance deprecate p \"new_p\" /1/"
gdb_test "p 5" \
- "Warning: '[limited_style p title]', an alias for the command '[limited_style print title]', is deprecated.*Use '[limited_style new_p title]'.*" \
+ "Warning: '[limited_style p command]', an alias for the command '[limited_style print command]', is deprecated.*Use '[limited_style new_p command]'.*" \
"p deprecated warning, with replacement"
# Check that the version string is styled in the output of 'show
# Now, for each style in turn. Disable that style only and run the
# test again. Things in that style should NOT now be styled.
-foreach style { title file function highlight variable \
+foreach style { command title file function highlight variable \
address metadata } {
set currently_disabled_style $style
with_test_prefix "disable style $style" {
proc style {str style} {
switch -exact -- $style {
title { set style 1 }
+ command { set style 1 }
file { set style 32 }
function { set style 33 }
highlight { set style 31 }