public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Ensure help message lines end with dot
@ 2021-04-09 12:02 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-04-09 12:02 UTC (permalink / raw)
  To: dwz, jakub, mark

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");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-09 12:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 12:02 [committed] Ensure help message lines end with dot Tom de Vries

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).