From patchwork Mon Jul 27 21:05:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Lindfors X-Patchwork-Id: 30280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 95E9DB7093 for ; Tue, 28 Jul 2009 07:09:32 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MVXOZ-0007Mo-7C; Mon, 27 Jul 2009 21:06:07 +0000 Received: from smtp-2.hut.fi ([130.233.228.92]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1MVXOU-0007MN-3i for linux-mtd@lists.infradead.org; Mon, 27 Jul 2009 21:06:06 +0000 Received: from localhost (katosiko.hut.fi [130.233.228.115]) by smtp-2.hut.fi (8.13.6/8.12.10) with ESMTP id n6RL5xg8027031 for ; Tue, 28 Jul 2009 00:05:59 +0300 Received: from smtp-2.hut.fi ([130.233.228.92]) by localhost (katosiko.hut.fi [130.233.228.115]) (amavisd-new, port 10024) with LMTP id 25894-502 for ; Tue, 28 Jul 2009 00:05:59 +0300 (EEST) Received: from mail.lan (quadrant.hut.fi [130.233.157.233]) by smtp-2.hut.fi (8.13.6/8.12.10) with ESMTP id n6RL5UGs026883 for ; Tue, 28 Jul 2009 00:05:30 +0300 Received: from lindi1.lan (lindi1.lan [10.7.6.28]) by mail.lan (Postfix) with ESMTPS id 8D01510F124 for ; Tue, 28 Jul 2009 00:05:30 +0300 (EEST) Received: from lindi by lindi1.lan with local (Exim 4.69) (envelope-from ) id 1MVXNy-0004eO-DU for linux-mtd@lists.infradead.org; Tue, 28 Jul 2009 00:05:30 +0300 To: linux-mtd@lists.infradead.org Subject: [PATCH] jffs2dump: rewrite --help output to be more suitable for help2man From: Timo Lindfors Date: Tue, 28 Jul 2009 00:05:30 +0300 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 X-TKK-Virus-Scanned: by amavisd-new-2.1.2-hutcc at katosiko.hut.fi X-Spam-Score: -4.0 (----) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (-4.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [130.233.228.92 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Timo Juhani Lindfors $ 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 --- jffs2dump.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) --- 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 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); }