All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timo Lindfors <lindi@kurp.hut.fi>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] jffs2dump: rewrite --help output to be more suitable for help2man
Date: Tue, 28 Jul 2009 00:05:30 +0300	[thread overview]
Message-ID: <kr8wi9et0l.fsf@lindi1.lan> (raw)

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>

$ help2man /usr/sbin/jffs2dump | man /dev/stdin

currently creates badly formatted output like

-b          --bigendian                 image is big endian
-l          --littleendian              image   is   little
endian  -c          --content                   dump  image
contents  -e  fname    --endianconvert=fname        convert
image endianness, output to file fname -r         --recalc-

This patch modifies the --help output for jffs2dump to be more
suitable for help2man and thus makes it possible to easily create
manual pages that stay up-to-date.

Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
---
 jffs2dump.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/jffs2dump.c b/jffs2dump.c
index c5a99df..2802682 100644
--- a/jffs2dump.c
+++ b/jffs2dump.c
@@ -52,19 +52,18 @@ char	*data;		// image data
 
 void display_help (void)
 {
-	printf("Usage: dumpjffs2 [OPTION] INPUTFILE\n"
-			"Dumps the contents of a binary JFFS2 image.\n"
-			"\n"
-			"           --help     	              display this help and exit\n"
-			"           --version  	              output version information and exit\n"
-			"-b         --bigendian	              image is big endian\n"
-			"-l         --littleendian             image is little endian\n"
-			"-c         --content  	              dump image contents\n"
-			"-e fname   --endianconvert=fname      convert image endianness, output to file fname\n"
-			"-r         --recalccrc                recalc name and data crc on endian conversion\n"
-			"-d len     --datsize=len              size of data chunks, when oob data in binary image (NAND only)\n"
-			"-o len     --oobsize=len              size of oob data chunk in binary image (NAND only)\n"
-			"-v         --verbose		      verbose output\n");
+	printf("Usage: " PROGRAM " [OPTION]... INPUTFILE\n"
+	       "Dump the contents of a binary JFFS2 image.\n\n"
+	       "     --help                   display this help and exit\n"
+	       "     --version                display version information and exit\n"
+	       " -b, --bigendian              image is big endian\n"
+	       " -l, --littleendian           image is little endian\n"
+	       " -c, --content                dump image contents\n"
+	       " -e, --endianconvert=FNAME    convert image endianness, output to file fname\n"
+	       " -r, --recalccrc              recalc name and data crc on endian conversion\n"
+	       " -d, --datsize=LEN            size of data chunks, when oob data in binary image (NAND only)\n"
+	       " -o, --oobsize=LEN            size of oob data chunk in binary image (NAND only)\n"
+	       " -v, --verbose                verbose output\n");
 	exit(0);
 }
 
---

If this patch looks ok, I'd be willing to write similar patches for at
least nandread, flash_erase and flash_eraseall tools that I use
regularly myself.

best regards,
Timo Lindfors

             reply	other threads:[~2009-07-27 21:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 21:05 Timo Lindfors [this message]
2009-08-09  7:01 ` [PATCH] jffs2dump: rewrite --help output to be more suitable for help2man Artem Bityutskiy

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=kr8wi9et0l.fsf@lindi1.lan \
    --to=lindi@kurp.hut.fi \
    --cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.