From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 04528389365C for ; Fri, 24 Apr 2020 20:47:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04528389365C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D8FDF116758; Fri, 24 Apr 2020 16:47:01 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YuucHoU+CZTk; Fri, 24 Apr 2020 16:47:01 -0400 (EDT) Received: from murgatroyd (184-96-229-138.hlrn.qwest.net [184.96.229.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 69D4C11623B; Fri, 24 Apr 2020 16:47:01 -0400 (EDT) From: Tom Tromey To: Philippe Waroquiers Cc: Tom Tromey , gdb-patches@sourceware.org, Tom Tromey Subject: Re: [PATCH] Use title style in help_list References: <20200424144618.21113-1-tromey@adacore.com> <87c6f31587d97ab4c9fc40c272e012f0db7fd96f.camel@skynet.be> X-Attribution: Tom Date: Fri, 24 Apr 2020 14:47:00 -0600 In-Reply-To: <87c6f31587d97ab4c9fc40c272e012f0db7fd96f.camel@skynet.be> (Philippe Waroquiers's message of "Fri, 24 Apr 2020 17:24:44 +0200") Message-ID: <87k124zk57.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-21.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 20:47:04 -0000 >>>>> "Philippe" == Philippe Waroquiers 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 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 * cli/cli-decode.c (help_list): Use title style. gdb/testsuite/ChangeLog 2020-04-24 Tom Tromey * 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 + + * cli/cli-decode.c (help_list): Use title style. + 2020-04-24 Tom Tromey 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 + + * 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 * 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]