mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
Replace uses of "title" style with "command"
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>
This commit is contained in:
@@ -1530,7 +1530,7 @@ add_com_suppress_notification (const char *name, enum command_class theclass,
|
||||
&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)
|
||||
@@ -1538,7 +1538,7 @@ 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);
|
||||
}
|
||||
|
||||
@@ -2509,21 +2509,21 @@ deprecated_cmd_warning (const char *text, struct cmd_list_element *list)
|
||||
|
||||
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.
|
||||
@@ -2536,7 +2536,7 @@ deprecated_cmd_warning (const char *text, struct cmd_list_element *list)
|
||||
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"));
|
||||
|
||||
@@ -1667,7 +1667,7 @@ show_user_1 (struct cmd_list_element *c, const char *prefix, const char *name,
|
||||
|
||||
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)
|
||||
|
||||
@@ -238,8 +238,8 @@ proc run_style_tests { } {
|
||||
"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:" \
|
||||
@@ -248,10 +248,10 @@ proc run_style_tests { } {
|
||||
"${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 \
|
||||
@@ -301,7 +301,7 @@ proc run_style_tests { } {
|
||||
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
|
||||
@@ -503,7 +503,7 @@ with_test_prefix "all styles enabled" {
|
||||
|
||||
# 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" {
|
||||
|
||||
@@ -69,6 +69,7 @@ proc string_list_to_regexp { args } {
|
||||
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 }
|
||||
|
||||
Reference in New Issue
Block a user