public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com, mark@klomp.org
Subject: [committed] Ensure help message lines end with dot
Date: Fri, 9 Apr 2021 14:02:09 +0200	[thread overview]
Message-ID: <20210409120207.GA4212@delia> (raw)

Hi,

I noticed a missing dot in the help message, after "parallel":
...
./dwz -?
  ...
  -j, --jobs <n>              Process <n> files in parallel
                              Default value: number of processors / 2.
...

Add an assert that catches this, and add the missing dot.

Committed to trunk.

Thanks,
- Tom

Ensure help message lines end with dot

2021-04-09  Tom de Vries  <tdevries@suse.de>

	* args.c (IMPLIES): New macro, copied from dwz.c.
	(dwz_multi_file_options_help): Add missing dot.
	(print_options_help): Assert that help messages end with dot.

---
 args.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/args.c b/args.c
index d44e632..23bf1d4 100644
--- a/args.c
+++ b/args.c
@@ -18,6 +18,7 @@
    the Free Software Foundation, 51 Franklin Street - Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
+#include <assert.h>
 #include <getopt.h>
 #include <stdbool.h>
 #include <stddef.h>
@@ -30,6 +31,8 @@
 
 #include "args.h"
 
+#define IMPLIES(A, B) (!((A) && !(B)))
+
 #if DEVEL
 int tracing;
 int ignore_size;
@@ -238,7 +241,7 @@ static struct option_help dwz_multi_file_options_help[] =
   { "e", "multifile-endian", "<l|b|auto>", "auto",
     "Set endianity of multifile." },
   { "j", "jobs", "<n>", "number of processors / 2",
-    "Process <n> files in parallel" }
+    "Process <n> files in parallel." }
 };
 
 /* Describe misc command line options.  */
@@ -350,6 +353,7 @@ print_options_help (FILE *stream, struct option_help *options_help, unsigned int
       s = options_help[i].msg;
       if (s)
 	{
+	  assert (IMPLIES (strlen (s) > 0, s[strlen (s) - 1] == '.'));
 	  if (len > indent)
 	    {
 	      fprintf (stream, "\n");

                 reply	other threads:[~2021-04-09 12:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210409120207.GA4212@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    --cc=mark@klomp.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).