Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 1/3] Add usage to printf command
Date: Thu, 15 Feb 2018 20:50:00 -0000	[thread overview]
Message-ID: <20180215205001.337-2-tom@tromey.com> (raw)
In-Reply-To: <20180215205001.337-1-tom@tromey.com>

This patch adds the "Usage:" text to the printf command's help text,
and tries to improve the text a tiny bit.

gdb/ChangeLog
2018-02-14  Tom Tromey  <tom@tromey.com>

	* printcmd.c (_initialize_printcmd): Add usage to printf.
---
 gdb/ChangeLog  | 4 ++++
 gdb/printcmd.c | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index fc9d7e4dd9..13b967f0a2 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -2680,8 +2680,9 @@ No argument means cancel all automatic-display expressions.\n\
 Do \"info display\" to see current list of code numbers."), &deletelist);
 
   add_com ("printf", class_vars, printf_command, _("\
-printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\
-This is useful for formatted output in user-defined commands."));
+Formatted printing, like the C \"printf\" function.\n\
+Usage: printf \"format string\", arg1, arg2, arg3, ..., argn\n\
+This supports most C printf format specifications, like %s, %d, etc."));
 
   add_com ("output", class_vars, output_command, _("\
 Like \"print\" but don't put in value history and don't print newline.\n\
-- 
2.13.6


  parent reply	other threads:[~2018-02-15 20:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 20:50 [RFA 0/3] a few minor printf fixes Tom Tromey
2018-02-15 20:50 ` [RFA 2/3] Allow - in %p for printf Tom Tromey
2018-02-16 11:31   ` Alan Hayward
2018-02-27  3:50     ` Tom Tromey
2018-02-15 20:50 ` Tom Tromey [this message]
     [not found]   ` <9E6EDAE0-C429-4581-9CAA-FF7B88796D40@arm.com>
2018-02-16 21:58     ` [RFA 1/3] Add usage to printf command Tom Tromey
2018-02-16 23:09       ` Simon Marchi
2018-02-19  9:16         ` Alan Hayward
2018-02-15 20:50 ` [RFA 3/3] Special case NULL when using printf's %s format Tom Tromey
     [not found]   ` <6abda67a-ad87-ebc7-e0d4-ab60e7e4cbc6@redhat.com>
2018-02-16 12:25     ` Pedro Alves
2018-02-16 21:58       ` Tom Tromey
2018-03-14 15:44 ` [RFA 0/3] a few minor printf fixes Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180215205001.337-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox