public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/thread: fine-tune 'info threads' help text
@ 2020-10-19 15:32 Tankut Baris Aktemur
  2020-10-19 15:39 ` Simon Marchi
  2020-10-19 16:04 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Tankut Baris Aktemur @ 2020-10-19 15:32 UTC (permalink / raw)
  To: gdb-patches

The help text of 'info threads' is below:

  (gdb) help info threads
  Display currently known threads.
  Usage: info threads [OPTION]... [ID]...

  Options:
    -gid
      Show global thread IDs.If ID is given, it is a space-separated list of IDs of threads to display.
  Otherwise, all threads are displayed.
  (gdb)

I think the "If ID is given ..." info should have come right below
the the usage line.  This patch reorganizes the text so that we get

  (gdb) help info threads
  Display currently known threads.
  Usage: info threads [OPTION]... [ID]...
  If ID is given, it is a space-separated list of IDs of threads to display.
  Otherwise, all threads are displayed.

  Options:
    -gid
      Show global thread IDs.
  (gdb)

gdb/ChangeLog:
2020-10-19  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	* thread.c (_initialize_thread): Fine-tune the help text of
	'info threads'.
---
 gdb/thread.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/thread.c b/gdb/thread.c
index d4994005449..d83244383d3 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -2183,11 +2183,11 @@ _initialize_thread ()
     = gdb::option::build_help (_("\
 Display currently known threads.\n\
 Usage: info threads [OPTION]... [ID]...\n\
+If ID is given, it is a space-separated list of IDs of threads to display.\n\
+Otherwise, all threads are displayed.\n\
 \n\
 Options:\n\
-%OPTIONS%\
-If ID is given, it is a space-separated list of IDs of threads to display.\n\
-Otherwise, all threads are displayed."),
+%OPTIONS%"),
 			       info_threads_opts);
 
   c = add_info ("threads", info_threads_command, info_threads_help.c_str ());
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gdb/thread: fine-tune 'info threads' help text
  2020-10-19 15:32 [PATCH] gdb/thread: fine-tune 'info threads' help text Tankut Baris Aktemur
@ 2020-10-19 15:39 ` Simon Marchi
  2020-10-19 15:57   ` Aktemur, Tankut Baris
  2020-10-19 16:04 ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2020-10-19 15:39 UTC (permalink / raw)
  To: Tankut Baris Aktemur, gdb-patches

On 2020-10-19 11:32 a.m., Tankut Baris Aktemur via Gdb-patches wrote:
> The help text of 'info threads' is below:
> 
>   (gdb) help info threads
>   Display currently known threads.
>   Usage: info threads [OPTION]... [ID]...
> 
>   Options:
>     -gid
>       Show global thread IDs.If ID is given, it is a space-separated list of IDs of threads to display.
>   Otherwise, all threads are displayed.
>   (gdb)
> 
> I think the "If ID is given ..." info should have come right below
> the the usage line.  This patch reorganizes the text so that we get
> 
>   (gdb) help info threads
>   Display currently known threads.
>   Usage: info threads [OPTION]... [ID]...
>   If ID is given, it is a space-separated list of IDs of threads to display.
>   Otherwise, all threads are displayed.
> 
>   Options:
>     -gid
>       Show global thread IDs.
>   (gdb)

Hmm yeah, the "before" text looks erroneous.

I would put a blank line just after the "Usage:", because I like when things are well visually separated.  But it LGTM regardless.

Simon

Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] gdb/thread: fine-tune 'info threads' help text
  2020-10-19 15:39 ` Simon Marchi
@ 2020-10-19 15:57   ` Aktemur, Tankut Baris
  2020-10-19 15:59     ` Simon Marchi
  2020-10-19 18:51     ` Philippe Waroquiers
  0 siblings, 2 replies; 6+ messages in thread
From: Aktemur, Tankut Baris @ 2020-10-19 15:57 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On Monday, October 19, 2020 5:39 PM, Simon Marchi wrote:
> On 2020-10-19 11:32 a.m., Tankut Baris Aktemur via Gdb-patches wrote:
> > The help text of 'info threads' is below:
> >
> >   (gdb) help info threads
> >   Display currently known threads.
> >   Usage: info threads [OPTION]... [ID]...
> >
> >   Options:
> >     -gid
> >       Show global thread IDs.If ID is given, it is a space-separated list of IDs of
> threads to display.
> >   Otherwise, all threads are displayed.
> >   (gdb)
> >
> > I think the "If ID is given ..." info should have come right below
> > the the usage line.  This patch reorganizes the text so that we get
> >
> >   (gdb) help info threads
> >   Display currently known threads.
> >   Usage: info threads [OPTION]... [ID]...
> >   If ID is given, it is a space-separated list of IDs of threads to display.
> >   Otherwise, all threads are displayed.
> >
> >   Options:
> >     -gid
> >       Show global thread IDs.
> >   (gdb)
> 
> Hmm yeah, the "before" text looks erroneous.
> 
> I would put a blank line just after the "Usage:", because I like when things are well
> visually separated.  But it LGTM regardless.

I agree, but I checked some other arbitrary commands manually, and also did a
`grep -A 1 "Usage:" *.c`, and found that a great portion of commands do not print that
separator newline.  For consistency, let me push without the newline. 

-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gdb/thread: fine-tune 'info threads' help text
  2020-10-19 15:57   ` Aktemur, Tankut Baris
@ 2020-10-19 15:59     ` Simon Marchi
  2020-10-19 18:51     ` Philippe Waroquiers
  1 sibling, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2020-10-19 15:59 UTC (permalink / raw)
  To: Aktemur, Tankut Baris, gdb-patches

On 2020-10-19 11:57 a.m., Aktemur, Tankut Baris via Gdb-patches wrote:
> I agree, but I checked some other arbitrary commands manually, and also did a
> `grep -A 1 "Usage:" *.c`, and found that a great portion of commands do not print that
> separator newline.  For consistency, let me push without the newline. 

Ok.

Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gdb/thread: fine-tune 'info threads' help text
  2020-10-19 15:32 [PATCH] gdb/thread: fine-tune 'info threads' help text Tankut Baris Aktemur
  2020-10-19 15:39 ` Simon Marchi
@ 2020-10-19 16:04 ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2020-10-19 16:04 UTC (permalink / raw)
  To: Tankut Baris Aktemur; +Cc: gdb-patches

> Date: Mon, 19 Oct 2020 17:32:38 +0200
> From: Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org>
> 
> diff --git a/gdb/thread.c b/gdb/thread.c
> index d4994005449..d83244383d3 100644
> --- a/gdb/thread.c
> +++ b/gdb/thread.c
> @@ -2183,11 +2183,11 @@ _initialize_thread ()
>      = gdb::option::build_help (_("\
>  Display currently known threads.\n\
>  Usage: info threads [OPTION]... [ID]...\n\
> +If ID is given, it is a space-separated list of IDs of threads to display.\n\
> +Otherwise, all threads are displayed.\n\
>  \n\
>  Options:\n\
> -%OPTIONS%\
> -If ID is given, it is a space-separated list of IDs of threads to display.\n\
> -Otherwise, all threads are displayed."),
> +%OPTIONS%"),
>  			       info_threads_opts);
>  
>    c = add_info ("threads", info_threads_command, info_threads_help.c_str ());

LGTM, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gdb/thread: fine-tune 'info threads' help text
  2020-10-19 15:57   ` Aktemur, Tankut Baris
  2020-10-19 15:59     ` Simon Marchi
@ 2020-10-19 18:51     ` Philippe Waroquiers
  1 sibling, 0 replies; 6+ messages in thread
From: Philippe Waroquiers @ 2020-10-19 18:51 UTC (permalink / raw)
  To: Aktemur, Tankut Baris, Simon Marchi, gdb-patches

On Mon, 2020-10-19 at 15:57 +0000, Aktemur, Tankut Baris via Gdb-patches wrote:
> > I would put a blank line just after the "Usage:", because I like when things are well
> > visually separated.  But it LGTM regardless.
> 
> I agree, but I checked some other arbitrary commands manually, and also did a
> `grep -A 1 "Usage:" *.c`, and found that a great portion of commands do not print that
> separator newline.  For consistency, let me push without the newline. 

Some conventions/invariants regarding the command help text
are verified by command-def-selftests.c

If we want to have consistently a blank line (or consistently no blank line)
before  Usage:, then that is an additional verification we can put in check_doc.

Philippe



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-19 18:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 15:32 [PATCH] gdb/thread: fine-tune 'info threads' help text Tankut Baris Aktemur
2020-10-19 15:39 ` Simon Marchi
2020-10-19 15:57   ` Aktemur, Tankut Baris
2020-10-19 15:59     ` Simon Marchi
2020-10-19 18:51     ` Philippe Waroquiers
2020-10-19 16:04 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).