Use title style in help_list

Message ID 20200424144618.21113-1-tromey@adacore.com
State New
Headers show
Series
  • Use title style in help_list
Related show

Commit Message

Tom Tromey April 24, 2020, 2:46 p.m.
From: Tom Tromey <tom@tromey.com>


This changes help_list to use "title" style, so that more commands
mentioned in their output are styled for the user.  This also slightly
changes the output here -- for the better, I think, because now it is
more i18n-friendly.

gdb/ChangeLog
2020-04-16  Tom Tromey  <tromey@adacore.com>

	* cli/cli-decode.c (help_list): Use title style.

gdb/testsuite/ChangeLog
2020-04-24  Tom Tromey  <tromey@adacore.com>

	* gdb.base/page.exp: Update expected output.
	* lib/gdb.exp (test_class_help): Update expected output.
	(test_prefix_command_help): Likewise.
	* gdb.base/default.exp: Update expected output.
---
 gdb/ChangeLog                      |  4 +++
 gdb/cli/cli-decode.c               | 39 ++++++++++++++----------------
 gdb/testsuite/ChangeLog            |  7 ++++++
 gdb/testsuite/gdb.base/default.exp | 20 +++++++--------
 gdb/testsuite/gdb.base/page.exp    |  2 +-
 gdb/testsuite/lib/gdb.exp          |  4 +--
 6 files changed, 42 insertions(+), 34 deletions(-)

-- 
2.21.1

Comments

Gary Benson via Gdb-patches April 24, 2020, 3:24 p.m. | #1
Hello Tom,

I tried the patch, the added styling increases the readability.
Thanks for this.

One comment:
I find the new
  Type "help" followed by the appropriate command name for full documentation.
longer and less clear than the old
  Type "help" followed by command name for full documentation.
because "the appropriate" makes my brain start to think about what would
be an inappropriate command name there, and what would instead
be an appropriate command.

So, I would just keep the old text, or maybe just add "a", to have:
  Type "help" followed by a command name for full documentation.
so as to have it similar to e.g.
  Type "help" followed by a class name for a list of commands in that class.

Thanks
Philippe

On Fri, 2020-04-24 at 08:46 -0600, Tom Tromey wrote:
> From: Tom Tromey <tom@tromey.com>

> 

> This changes help_list to use "title" style, so that more commands

> mentioned in their output are styled for the user.  This also slightly

> changes the output here -- for the better, I think, because now it is

> more i18n-friendly.

> 

> gdb/ChangeLog

> 2020-04-16  Tom Tromey  <tromey@adacore.com>

> 

> 	* cli/cli-decode.c (help_list): Use title style.

> 

> gdb/testsuite/ChangeLog

> 2020-04-24  Tom Tromey  <tromey@adacore.com>

> 

> 	* gdb.base/page.exp: Update expected output.

> 	* lib/gdb.exp (test_class_help): Update expected output.

> 	(test_prefix_command_help): Likewise.

> 	* gdb.base/default.exp: Update expected output.

> ---

>  gdb/ChangeLog                      |  4 +++

>  gdb/cli/cli-decode.c               | 39 ++++++++++++++----------------

>  gdb/testsuite/ChangeLog            |  7 ++++++

>  gdb/testsuite/gdb.base/default.exp | 20 +++++++--------

>  gdb/testsuite/gdb.base/page.exp    |  2 +-

>  gdb/testsuite/lib/gdb.exp          |  4 +--

>  6 files changed, 42 insertions(+), 34 deletions(-)

> 

> diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c

> index 17f49ec80e4..32774821a8b 100644

> --- a/gdb/cli/cli-decode.c

> +++ b/gdb/cli/cli-decode.c

> @@ -1200,29 +1200,26 @@ help_list (struct cmd_list_element *list, const char *cmdtype,

>  

>    if (theclass == all_classes)

>      {

> -      fprintf_filtered (stream, "\n\

> -Type \"help%s\" followed by a class name for a list of commands in ",

> -			cmdtype1);

> -      wrap_here ("");

> -      fprintf_filtered (stream, "that class.");

> -

> -      fprintf_filtered (stream, "\n\

> -Type \"help all\" for the list of all commands.");

> +      fprintf_filtered (stream, _("\n\

> +Type \"%p[help%s%p]\" followed by a class name for a list of commands "

> +				  "in that class.\n"),

> +			title_style.style ().ptr (), cmdtype1, nullptr);

> +

> +      fprintf_filtered (stream,

> +			_("Type \"%ps\" for the list of all commands."),

> +			styled_string (title_style.style (), "help all"));

>      }

>  

> -  fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ",

> -		    cmdtype1, cmdtype2);

> -  wrap_here ("");

> -  fputs_filtered ("for ", stream);

> -  wrap_here ("");

> -  fputs_filtered ("full ", stream);

> -  wrap_here ("");

> -  fputs_filtered ("documentation.\n", stream);

> -  fputs_filtered ("Type \"apropos word\" to search "

> -		  "for commands related to \"word\".\n", stream);

> -  fputs_filtered ("Type \"apropos -v word\" for full documentation", stream);

> -  wrap_here ("");

> -  fputs_filtered (" of commands related to \"word\".\n", stream);

> +  fprintf_filtered (stream, _("\nType \"%p[help%s%p]\" followed by the appropriate "

> +			      "command name for full documentation.\n"),

> +		    title_style.style ().ptr (), cmdtype1, nullptr);

> +

> +  fprintf_filtered (stream, _("Type \"%ps word\" to search "

> +			      "for commands related to \"word\".\n"),

> +		    styled_string (title_style.style (), "apropos"));

> +  fprintf_filtered (stream, _("Type \"%ps word\" for full documentation"

> +			      " of commands related to \"word\".\n"),

> +		    styled_string (title_style.style (), "apropos -v"));

>    fputs_filtered ("Command name abbreviations are allowed if unambiguous.\n",

>  		  stream);

>  }

> diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp

> index 846c91af6bc..a70a6181213 100644

> --- a/gdb/testsuite/gdb.base/default.exp

> +++ b/gdb/testsuite/gdb.base/default.exp

> @@ -247,15 +247,15 @@ gdb_test_multiple "generate-core-file" "generate-core-file" {

>  }

>  

>  #test help "h" abbreviation

> -gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"

> +gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"

>  #test help

> -gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

> +gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

>  #test handle

>  gdb_test "handle" "Argument required .signal to handle.*"

>  #test info "i" abbreviation 

> -gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"

> +gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"

>  #test info

> -gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

> +gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

>  #test ignore

>  gdb_test "ignore" "Argument required .a breakpoint number.*"

>  #test info address

> @@ -475,7 +475,7 @@ gdb_test_no_output "set args" "set args"

>  

>  # Test set check abbreviations

>  foreach x {"c" "ch" "check"} {

> -    gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \

> +    gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \

>  	"set check \"$x\" abbreviation"

>  }

>  

> @@ -505,17 +505,17 @@ gdb_test_no_output "set history save" "set history save"

>  #test set history size

>  gdb_test "set history size" "Argument required .integer to set it to.*"

>  #test set history

> -gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

> +gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

>  #test set language

>  gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust."

>  #test set listsize

>  gdb_test "set listsize" "Argument required .integer to set it to.*"

>  #test set print "p" abbreviation

> -gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"

> +gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"

>  #test set print "pr" abbreviation

> -gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"

> +gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"

>  #test set print

> -gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

> +gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

>  #test set print address

>  gdb_test_no_output "set print address" "set print address"

>  #test set print array

> @@ -827,7 +827,7 @@ gdb_test "unset environment" \

>      "y"

>  

>  #test unset

> -gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

> +gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."

>  #test up

>  #test up-silently

>  gdb_test "up-silently" "No stack."

> diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp

> index c34c886c644..a41a0990821 100644

> --- a/gdb/testsuite/gdb.base/page.exp

> +++ b/gdb/testsuite/gdb.base/page.exp

> @@ -37,7 +37,7 @@ gdb_test_sequence "help" "unpaged help" {

>      "user-defined -- User-defined commands"

>      ""

>      "Type .help. followed by a class name for a list of commands in that class."

> -    "Type .help. followed by command name for full documentation."

> +    "Type .help. followed by the appropriate command name for full documentation."

>      "Command name abbreviations are allowed if unambiguous."

>  }

>  

> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp

> index cdf96e3c703..e56ff78251a 100644

> --- a/gdb/testsuite/lib/gdb.exp

> +++ b/gdb/testsuite/lib/gdb.exp

> @@ -5958,7 +5958,7 @@ proc test_class_help { command_class expected_initial_lines {list_of_commands {}

>          set l_list_of_commands {"List of commands\:.*[\r\n]+"}

>      }

>      set l_stock_body {

> -        "Type \"help\" followed by command name for full documentation\.[\r\n]+"

> +        "Type \"help\" followed by the appropriate command name for full documentation\.[\r\n]+"

>      }

>      set l_entire_body [concat $expected_initial_lines $l_list_of_commands \

>  		       $l_stock_body $help_list_trailer]

> @@ -5995,7 +5995,7 @@ proc test_prefix_command_help { command_list expected_initial_lines args } {

>      # be expanded in this list.

>      set l_stock_body [list\

>           "List of $full_command subcommands\:.*\[\r\n\]+"\

> -         "Type \"help $full_command\" followed by $full_command subcommand name for full documentation\.\[\r\n\]+"]

> +         "Type \"help $full_command\" followed by the appropriate command name for full documentation\.\[\r\n\]+"]

>      set l_entire_body [concat $expected_initial_lines $l_stock_body $help_list_trailer]

>      if {[llength $args]>0} {

>          help_test_raw "help ${command}" $l_entire_body [lindex $args 0]
Tom Tromey April 24, 2020, 8:47 p.m. | #2
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:


Philippe> I tried the patch, the added styling increases the readability.

Thanks for doing that.

Philippe> One comment:
Philippe> I find the new
Philippe>   Type "help" followed by the appropriate command name for full documentation.
Philippe> longer and less clear than the old
Philippe>   Type "help" followed by command name for full documentation.
Philippe> because "the appropriate" makes my brain start to think about what would
Philippe> be an inappropriate command name there, and what would instead
Philippe> be an appropriate command.

Philippe> So, I would just keep the old text, or maybe just add "a", to have:
Philippe>   Type "help" followed by a command name for full documentation.
Philippe> so as to have it similar to e.g.
Philippe>   Type "help" followed by a class name for a list of commands in that class.

The appended changes it to just "a command name".
Let me know what you think.

Tom

commit 06ce7a9351110c841e36f8a9a7486555b1cf8db7
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Apr 15 20:47:44 2020 -0600

    Use title style in help_list
    
    This changes help_list to use "title" style, so that more commands
    mentioned in their output are styled for the user.  This also slightly
    changes the output here -- for the better, I think, because now it is
    more i18n-friendly.
    
    gdb/ChangeLog
    2020-04-16  Tom Tromey  <tromey@adacore.com>
    
            * cli/cli-decode.c (help_list): Use title style.
    
    gdb/testsuite/ChangeLog
    2020-04-24  Tom Tromey  <tromey@adacore.com>
    
            * gdb.base/page.exp: Update expected output.
            * lib/gdb.exp (test_class_help): Update expected output.
            (test_prefix_command_help): Likewise.
            * gdb.base/default.exp: Update expected output.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8911ff5dfdb..138d2e6b207 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-16  Tom Tromey  <tromey@adacore.com>
+
+	* cli/cli-decode.c (help_list): Use title style.
+
 2020-04-24  Tom Tromey  <tromey@adacore.com>
 
 	PR python/23662:
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 17f49ec80e4..bcd60b9beb9 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1200,29 +1200,26 @@ help_list (struct cmd_list_element *list, const char *cmdtype,
 
   if (theclass == all_classes)
     {
-      fprintf_filtered (stream, "\n\
-Type \"help%s\" followed by a class name for a list of commands in ",
-			cmdtype1);
-      wrap_here ("");
-      fprintf_filtered (stream, "that class.");
-
-      fprintf_filtered (stream, "\n\
-Type \"help all\" for the list of all commands.");
+      fprintf_filtered (stream, _("\n\
+Type \"%p[help%s%p]\" followed by a class name for a list of commands "
+				  "in that class.\n"),
+			title_style.style ().ptr (), cmdtype1, nullptr);
+
+      fprintf_filtered (stream,
+			_("Type \"%ps\" for the list of all commands."),
+			styled_string (title_style.style (), "help all"));
     }
 
-  fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ",
-		    cmdtype1, cmdtype2);
-  wrap_here ("");
-  fputs_filtered ("for ", stream);
-  wrap_here ("");
-  fputs_filtered ("full ", stream);
-  wrap_here ("");
-  fputs_filtered ("documentation.\n", stream);
-  fputs_filtered ("Type \"apropos word\" to search "
-		  "for commands related to \"word\".\n", stream);
-  fputs_filtered ("Type \"apropos -v word\" for full documentation", stream);
-  wrap_here ("");
-  fputs_filtered (" of commands related to \"word\".\n", stream);
+  fprintf_filtered (stream, _("\nType \"%p[help%s%p]\" followed by a "
+			      "command name for full documentation.\n"),
+		    title_style.style ().ptr (), cmdtype1, nullptr);
+
+  fprintf_filtered (stream, _("Type \"%ps word\" to search "
+			      "for commands related to \"word\".\n"),
+		    styled_string (title_style.style (), "apropos"));
+  fprintf_filtered (stream, _("Type \"%ps word\" for full documentation"
+			      " of commands related to \"word\".\n"),
+		    styled_string (title_style.style (), "apropos -v"));
   fputs_filtered ("Command name abbreviations are allowed if unambiguous.\n",
 		  stream);
 }
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 3458a54c535..782aba3df70 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2020-04-24  Tom Tromey  <tromey@adacore.com>
+
+	* gdb.base/page.exp: Update expected output.
+	* lib/gdb.exp (test_class_help): Update expected output.
+	(test_prefix_command_help): Likewise.
+	* gdb.base/default.exp: Update expected output.
+
 2020-04-24  Tom Tromey  <tromey@adacore.com>
 
 	* gdb.ada/frame_arg_lang.exp: Run with multiple -fgnat-encodings
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 846c91af6bc..dddf7b18a55 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -247,15 +247,15 @@ gdb_test_multiple "generate-core-file" "generate-core-file" {
 }
 
 #test help "h" abbreviation
-gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
+gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
 #test help
-gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test handle
 gdb_test "handle" "Argument required .signal to handle.*"
 #test info "i" abbreviation 
-gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
+gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
 #test info
-gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test ignore
 gdb_test "ignore" "Argument required .a breakpoint number.*"
 #test info address
@@ -475,7 +475,7 @@ gdb_test_no_output "set args" "set args"
 
 # Test set check abbreviations
 foreach x {"c" "ch" "check"} {
-    gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
+    gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
 	"set check \"$x\" abbreviation"
 }
 
@@ -505,17 +505,17 @@ gdb_test_no_output "set history save" "set history save"
 #test set history size
 gdb_test "set history size" "Argument required .integer to set it to.*"
 #test set history
-gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test set language
 gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust."
 #test set listsize
 gdb_test "set listsize" "Argument required .integer to set it to.*"
 #test set print "p" abbreviation
-gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
+gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
 #test set print "pr" abbreviation
-gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
+gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
 #test set print
-gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test set print address
 gdb_test_no_output "set print address" "set print address"
 #test set print array
@@ -827,7 +827,7 @@ gdb_test "unset environment" \
     "y"
 
 #test unset
-gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by a command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test up
 #test up-silently
 gdb_test "up-silently" "No stack."
diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp
index c34c886c644..2af6226d9f4 100644
--- a/gdb/testsuite/gdb.base/page.exp
+++ b/gdb/testsuite/gdb.base/page.exp
@@ -37,7 +37,7 @@ gdb_test_sequence "help" "unpaged help" {
     "user-defined -- User-defined commands"
     ""
     "Type .help. followed by a class name for a list of commands in that class."
-    "Type .help. followed by command name for full documentation."
+    "Type .help. followed by a command name for full documentation."
     "Command name abbreviations are allowed if unambiguous."
 }
 
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 2208f3a1a9b..74ddfc01209 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5958,7 +5958,7 @@ proc test_class_help { command_class expected_initial_lines {list_of_commands {}
         set l_list_of_commands {"List of commands\:.*[\r\n]+"}
     }
     set l_stock_body {
-        "Type \"help\" followed by command name for full documentation\.[\r\n]+"
+        "Type \"help\" followed by a command name for full documentation\.[\r\n]+"
     }
     set l_entire_body [concat $expected_initial_lines $l_list_of_commands \
 		       $l_stock_body $help_list_trailer]
@@ -5995,7 +5995,7 @@ proc test_prefix_command_help { command_list expected_initial_lines args } {
     # be expanded in this list.
     set l_stock_body [list\
          "List of $full_command subcommands\:.*\[\r\n\]+"\
-         "Type \"help $full_command\" followed by $full_command subcommand name for full documentation\.\[\r\n\]+"]
+         "Type \"help $full_command\" followed by a command name for full documentation\.\[\r\n\]+"]
     set l_entire_body [concat $expected_initial_lines $l_stock_body $help_list_trailer]
     if {[llength $args]>0} {
         help_test_raw "help ${command}" $l_entire_body [lindex $args 0]
Gary Benson via Gdb-patches April 25, 2020, 11:55 a.m. | #3
On Fri, 2020-04-24 at 14:47 -0600, Tom Tromey wrote:

> The appended changes it to just "a command name".

> Let me know what you think.

Thanks.

I also just saw that the patch modifies the subcommand help
e.g. for 'help thread'
  List of thread subcommands:

  thread apply -- Apply a command to a list of threads.
  thread find -- Find threads that match a regular expression.
  thread name -- Set the current thread's name.

...
  Type "help thread" followed by thread subcommand name for full documentation.

was changed into:
  Type "help thread" followed by a command name for full documentation.

For such help about prefix command, I am wondering what is preferrable
between:
   "a thread subcommand name"
   "a subcommand name"
   "a command name"

As the 'List ' line above speaks about subcommand, probably
better to at least reference again subcommand ?

Thanks

Philippe

Patch

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 17f49ec80e4..32774821a8b 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1200,29 +1200,26 @@  help_list (struct cmd_list_element *list, const char *cmdtype,
 
   if (theclass == all_classes)
     {
-      fprintf_filtered (stream, "\n\
-Type \"help%s\" followed by a class name for a list of commands in ",
-			cmdtype1);
-      wrap_here ("");
-      fprintf_filtered (stream, "that class.");
-
-      fprintf_filtered (stream, "\n\
-Type \"help all\" for the list of all commands.");
+      fprintf_filtered (stream, _("\n\
+Type \"%p[help%s%p]\" followed by a class name for a list of commands "
+				  "in that class.\n"),
+			title_style.style ().ptr (), cmdtype1, nullptr);
+
+      fprintf_filtered (stream,
+			_("Type \"%ps\" for the list of all commands."),
+			styled_string (title_style.style (), "help all"));
     }
 
-  fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ",
-		    cmdtype1, cmdtype2);
-  wrap_here ("");
-  fputs_filtered ("for ", stream);
-  wrap_here ("");
-  fputs_filtered ("full ", stream);
-  wrap_here ("");
-  fputs_filtered ("documentation.\n", stream);
-  fputs_filtered ("Type \"apropos word\" to search "
-		  "for commands related to \"word\".\n", stream);
-  fputs_filtered ("Type \"apropos -v word\" for full documentation", stream);
-  wrap_here ("");
-  fputs_filtered (" of commands related to \"word\".\n", stream);
+  fprintf_filtered (stream, _("\nType \"%p[help%s%p]\" followed by the appropriate "
+			      "command name for full documentation.\n"),
+		    title_style.style ().ptr (), cmdtype1, nullptr);
+
+  fprintf_filtered (stream, _("Type \"%ps word\" to search "
+			      "for commands related to \"word\".\n"),
+		    styled_string (title_style.style (), "apropos"));
+  fprintf_filtered (stream, _("Type \"%ps word\" for full documentation"
+			      " of commands related to \"word\".\n"),
+		    styled_string (title_style.style (), "apropos -v"));
   fputs_filtered ("Command name abbreviations are allowed if unambiguous.\n",
 		  stream);
 }
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 846c91af6bc..a70a6181213 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -247,15 +247,15 @@  gdb_test_multiple "generate-core-file" "generate-core-file" {
 }
 
 #test help "h" abbreviation
-gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
+gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
 #test help
-gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test handle
 gdb_test "handle" "Argument required .signal to handle.*"
 #test info "i" abbreviation 
-gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
+gdb_test "i" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
 #test info
-gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "info" "List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test ignore
 gdb_test "ignore" "Argument required .a breakpoint number.*"
 #test info address
@@ -475,7 +475,7 @@  gdb_test_no_output "set args" "set args"
 
 # Test set check abbreviations
 foreach x {"c" "ch" "check"} {
-    gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
+    gdb_test "set $x" "List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
 	"set check \"$x\" abbreviation"
 }
 
@@ -505,17 +505,17 @@  gdb_test_no_output "set history save" "set history save"
 #test set history size
 gdb_test "set history size" "Argument required .integer to set it to.*"
 #test set history
-gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "set history" "List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test set language
 gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, asm, c, c.., d, fortran, go, minimal, modula-2, objective-c, opencl, pascal, rust."
 #test set listsize
 gdb_test "set listsize" "Argument required .integer to set it to.*"
 #test set print "p" abbreviation
-gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
+gdb_test "set p" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
 #test set print "pr" abbreviation
-gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
+gdb_test "set pr" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
 #test set print
-gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "set print" "List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test set print address
 gdb_test_no_output "set print address" "set print address"
 #test set print array
@@ -827,7 +827,7 @@  gdb_test "unset environment" \
     "y"
 
 #test unset
-gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
+gdb_test "unset" "List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by the appropriate command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous."
 #test up
 #test up-silently
 gdb_test "up-silently" "No stack."
diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp
index c34c886c644..a41a0990821 100644
--- a/gdb/testsuite/gdb.base/page.exp
+++ b/gdb/testsuite/gdb.base/page.exp
@@ -37,7 +37,7 @@  gdb_test_sequence "help" "unpaged help" {
     "user-defined -- User-defined commands"
     ""
     "Type .help. followed by a class name for a list of commands in that class."
-    "Type .help. followed by command name for full documentation."
+    "Type .help. followed by the appropriate command name for full documentation."
     "Command name abbreviations are allowed if unambiguous."
 }
 
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index cdf96e3c703..e56ff78251a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5958,7 +5958,7 @@  proc test_class_help { command_class expected_initial_lines {list_of_commands {}
         set l_list_of_commands {"List of commands\:.*[\r\n]+"}
     }
     set l_stock_body {
-        "Type \"help\" followed by command name for full documentation\.[\r\n]+"
+        "Type \"help\" followed by the appropriate command name for full documentation\.[\r\n]+"
     }
     set l_entire_body [concat $expected_initial_lines $l_list_of_commands \
 		       $l_stock_body $help_list_trailer]
@@ -5995,7 +5995,7 @@  proc test_prefix_command_help { command_list expected_initial_lines args } {
     # be expanded in this list.
     set l_stock_body [list\
          "List of $full_command subcommands\:.*\[\r\n\]+"\
-         "Type \"help $full_command\" followed by $full_command subcommand name for full documentation\.\[\r\n\]+"]
+         "Type \"help $full_command\" followed by the appropriate command name for full documentation\.\[\r\n\]+"]
     set l_entire_body [concat $expected_initial_lines $l_stock_body $help_list_trailer]
     if {[llength $args]>0} {
         help_test_raw "help ${command}" $l_entire_body [lindex $args 0]