public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: debugedit@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] debugedit: Add manual using help2man
Date: Thu, 29 Apr 2021 18:27:22 +0200	[thread overview]
Message-ID: <20210429162722.21085-1-mark@klomp.org> (raw)

This generates a debugedit.1 man page using help2man based on the
debugedit --help output.  The generated file is included in the dist
so help2man isn't normally needed to build debugedit.

	* .gitignore: Add debugedit.1
	* configure.ac: Add AM_MISSING_PROG for help2man.
	* Makefile.am (dist_man_MANS): Add debugedit.1
	(debugedit.1): New rules.
	* tools/debugedit (helpText): Add FILE argument.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 .gitignore        | 1 +
 Makefile.am       | 9 +++++++++
 configure.ac      | 1 +
 tools/debugedit.c | 2 +-
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 7225070..55d4bfc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ missing
 .dirstamp
 
 debugedit
+debugedit.1
 sepdebugcrcfix
 
 atconfig
diff --git a/Makefile.am b/Makefile.am
index bd28eba..5042785 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,6 +38,15 @@ sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
 sepdebugcrcfix_CFLAGS = @LIBELF_CFLAGS@ $(AM_CFLAGS)
 sepdebugcrcfix_LDADD = @LIBELF_LIBS@
 
+# Manual pages are generated for dist
+dist_man_MANS = debugedit.1
+
+debugedit.1: tools/debugedit.c $(top_srcdir)/configure.ac
+	$(MAKE) $(AM_MAKEFLAGS) debugedit$(EXEEXT)
+	$(HELP2MAN) -N --output=$@ \
+	  --name='debug source path manipulation tool' \
+	  ./debugedit$(EXEEXT)
+
 noinst_HEADERS= tools/ansidecl.h \
 		tools/hashtab.h \
 		tools/md5.h \
diff --git a/configure.ac b/configure.ac
index c5adadf..e7a7989 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,6 +43,7 @@ AC_PROG_AWK
 AC_PROG_CC_C99
 AC_PROG_LN_S
 AC_CHECK_TOOL([LD], [ld])
+AM_MISSING_PROG(HELP2MAN, help2man)
 
 # Only really an issue on 32bit platforms. Makes sure we'll get large off_t.
 AC_SYS_LARGEFILE
diff --git a/tools/debugedit.c b/tools/debugedit.c
index f84c7ef..c6975b2 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -3034,7 +3034,7 @@ static struct option optionsTable[] =
 static const char *optionsChars = "b:d:l:is:nV?";
 
 static const char *helpText =
-  "Usage: %s [OPTION...]\n"
+  "Usage: %s [OPTION...] FILE\n"
   "  -b, --base-dir=STRING           base build directory of objects\n"
   "  -d, --dest-dir=STRING           directory to rewrite base-dir into\n"
   "  -l, --list-file=STRING          file where to put list of source and \n"
-- 
2.18.4


             reply	other threads:[~2021-04-29 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 16:27 Mark Wielaard [this message]
2021-04-29 16:36 ` Dmitry V. Levin
2021-04-29 18:47   ` Mark Wielaard

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=20210429162722.21085-1-mark@klomp.org \
    --to=mark@klomp.org \
    --cc=debugedit@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).