From patchwork Sat Jan 26 02:31:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1031370 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43mg034jD4z9s7T for ; Sat, 26 Jan 2019 13:32:15 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 373FBC21E16; Sat, 26 Jan 2019 02:32:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6A204C21D65; Sat, 26 Jan 2019 02:32:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 91C00C21D8E; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 44B04C21D65 for ; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from hades.home (unknown [IPv6:2a00:23c5:58d:db00:68bb:47d:d5ca:9abd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 19E2A26070C; Sat, 26 Jan 2019 02:32:03 +0000 (GMT) From: Martyn Welch To: Tom Rini Date: Sat, 26 Jan 2019 02:31:50 +0000 Message-Id: <20190126023154.19749-1-martyn.welch@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Martyn Welch , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/5] tools: dumpimage: Provide more feedback on error X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The dumpimage utility errors out in a number of places without providing sufficient feedback to allow the user to easily determine what they have done wrong. Add addtional error messages to make the cause of the failure more obvious. Signed-off-by: Martyn Welch --- tools/dumpimage.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/dumpimage.c b/tools/dumpimage.c index 7115df04c1..2847e6c0b4 100644 --- a/tools/dumpimage.c +++ b/tools/dumpimage.c @@ -80,6 +80,8 @@ int main(int argc, char **argv) case 'T': params.type = genimg_get_type_id(optarg); if (params.type < 0) { + fprintf(stderr, "%s: Invalid type\n", + params.cmdname); usage(); } break; @@ -101,8 +103,10 @@ int main(int argc, char **argv) } } - if (optind >= argc) + if (optind >= argc) { + fprintf(stderr, "%s: image file missing\n", params.cmdname); usage(); + } /* set tparams as per input type_id */ tparams = imagetool_get_type(params.type); @@ -117,8 +121,11 @@ int main(int argc, char **argv) * as per image type to be generated/listed */ if (tparams->check_params) { - if (tparams->check_params(¶ms)) + if (tparams->check_params(¶ms)) { + fprintf(stderr, "%s: Parameter check failed\n", + params.cmdname); usage(); + } } if (params.iflag) From patchwork Sat Jan 26 02:31:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1031371 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43mg0Z4GSxz9s7T for ; Sat, 26 Jan 2019 13:32:46 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3EDEBC21DF9; Sat, 26 Jan 2019 02:32:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C6824C21DA6; Sat, 26 Jan 2019 02:32:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9B40EC21CB6; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 44821C21CB6 for ; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from hades.home (unknown [IPv6:2a00:23c5:58d:db00:68bb:47d:d5ca:9abd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 6BE4F26C2EB; Sat, 26 Jan 2019 02:32:03 +0000 (GMT) From: Martyn Welch To: Tom Rini Date: Sat, 26 Jan 2019 02:31:51 +0000 Message-Id: <20190126023154.19749-2-martyn.welch@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126023154.19749-1-martyn.welch@collabora.com> References: <20190126023154.19749-1-martyn.welch@collabora.com> MIME-Version: 1.0 Cc: Martyn Welch , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/5] tools: dumpimage: Simplify arguments X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The dump image utility has very confusing syntax. If called to list image contents ("-l") it takes the image name as a positional argument. If the utility is called to extract something from the image, the image must be provided via the optional argument "-i" as well as the positional argument but the value passed in the positional argument will be completely ignored. Simplify dumpimage by always providing the image as the first positional argument. Assume we want to dump something from the image if we do not provide the "-l" option for now. Signed-off-by: Martyn Welch --- tools/dumpimage.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tools/dumpimage.c b/tools/dumpimage.c index 2847e6c0b4..1b92dec364 100644 --- a/tools/dumpimage.c +++ b/tools/dumpimage.c @@ -65,17 +65,14 @@ int main(int argc, char **argv) params.cmdname = *argv; - while ((opt = getopt(argc, argv, "li:o:T:p:V")) != -1) { + while ((opt = getopt(argc, argv, "lo:T:p:V")) != -1) { switch (opt) { case 'l': params.lflag = 1; break; - case 'i': - params.imagefile = optarg; - params.iflag = 1; - break; case 'o': params.outfile = optarg; + params.iflag = 1; break; case 'T': params.type = genimg_get_type_id(optarg); @@ -108,6 +105,8 @@ int main(int argc, char **argv) usage(); } + params.imagefile = argv[optind]; + /* set tparams as per input type_id */ tparams = imagetool_get_type(params.type); if (tparams == NULL) { @@ -128,12 +127,11 @@ int main(int argc, char **argv) } } - if (params.iflag) - params.datafile = argv[optind]; - else - params.imagefile = argv[optind]; - if (!params.outfile) - params.outfile = params.datafile; + if (!params.lflag && !params.outfile) { + fprintf(stderr, "%s: No output file provided\n", + params.cmdname); + exit(EXIT_FAILURE); + } ifd = open(params.imagefile, O_RDONLY|O_BINARY); if (ifd < 0) { @@ -204,10 +202,9 @@ static void usage(void) " -l ==> list image header information\n", params.cmdname); fprintf(stderr, - " %s -i image -T type [-p position] [-o outfile] data_file\n" - " -i ==> extract from the 'image' a specific 'data_file'\n" + " %s -T type [-p position] [-o outfile] image\n" " -T ==> set image type to 'type'\n" - " -p ==> 'position' (starting at 0) of the 'data_file' inside the 'image'\n", + " -p ==> 'position' (starting at 0) of the component to extract from image\n", params.cmdname); fprintf(stderr, " %s -V ==> print version information and exit\n", From patchwork Sat Jan 26 02:31:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1031374 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43mg1L2vVFz9s7T for ; Sat, 26 Jan 2019 13:33:26 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 0945CC21DD7; Sat, 26 Jan 2019 02:32:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS,T_FRT_BELOW2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 60895C21DE8; Sat, 26 Jan 2019 02:32:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C927BC21CB6; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 4E913C21D83 for ; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from hades.home (unknown [IPv6:2a00:23c5:58d:db00:68bb:47d:d5ca:9abd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id EFD0A27D670; Sat, 26 Jan 2019 02:32:03 +0000 (GMT) From: Martyn Welch To: Tom Rini Date: Sat, 26 Jan 2019 02:31:52 +0000 Message-Id: <20190126023154.19749-3-martyn.welch@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126023154.19749-1-martyn.welch@collabora.com> References: <20190126023154.19749-1-martyn.welch@collabora.com> MIME-Version: 1.0 Cc: Martyn Welch , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 3/5] tools: dumpimage: Simplify internal logic X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" There are 3 supported modes of operation: 1) Show version 2) List image contents 3) Extract image component Option (1) terminates early, so only options (2) and (3) remain. Remove redundant check for these modes. Signed-off-by: Martyn Welch --- tools/dumpimage.c | 85 +++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 48 deletions(-) diff --git a/tools/dumpimage.c b/tools/dumpimage.c index 1b92dec364..e17e979b04 100644 --- a/tools/dumpimage.c +++ b/tools/dumpimage.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) int ifd = -1; struct stat sbuf; char *ptr; - int retval = 0; + int retval = EXIT_SUCCESS; struct image_type_params *tparams = NULL; params.cmdname = *argv; @@ -135,65 +135,54 @@ int main(int argc, char **argv) ifd = open(params.imagefile, O_RDONLY|O_BINARY); if (ifd < 0) { - fprintf(stderr, "%s: Can't open \"%s\": %s\n", - params.cmdname, params.imagefile, - strerror(errno)); + fprintf(stderr, "%s: Can't open \"%s\": %s\n", params.cmdname, + params.imagefile, strerror(errno)); exit(EXIT_FAILURE); } - if (params.lflag || params.iflag) { - if (fstat(ifd, &sbuf) < 0) { - fprintf(stderr, "%s: Can't stat \"%s\": %s\n", - params.cmdname, params.imagefile, - strerror(errno)); - exit(EXIT_FAILURE); - } + if (fstat(ifd, &sbuf) < 0) { + fprintf(stderr, "%s: Can't stat \"%s\": %s\n", params.cmdname, + params.imagefile, strerror(errno)); + exit(EXIT_FAILURE); + } - if ((uint32_t)sbuf.st_size < tparams->header_size) { - fprintf(stderr, - "%s: Bad size: \"%s\" is not valid image\n", - params.cmdname, params.imagefile); - exit(EXIT_FAILURE); - } + if ((uint32_t)sbuf.st_size < tparams->header_size) { + fprintf(stderr, "%s: Bad size: \"%s\" is not valid image\n", + params.cmdname, params.imagefile); + exit(EXIT_FAILURE); + } - ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, ifd, 0); - if (ptr == MAP_FAILED) { - fprintf(stderr, "%s: Can't read \"%s\": %s\n", - params.cmdname, params.imagefile, - strerror(errno)); - exit(EXIT_FAILURE); - } + ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, ifd, 0); + if (ptr == MAP_FAILED) { + fprintf(stderr, "%s: Can't read \"%s\": %s\n", params.cmdname, + params.imagefile, strerror(errno)); + exit(EXIT_FAILURE); + } + /* + * Both calls bellow scan through dumpimage registry for all + * supported image types and verify the input image file + * header for match + */ + if (params.iflag) { /* - * Both calls bellow scan through dumpimage registry for all - * supported image types and verify the input image file - * header for match + * Extract the data files from within the matched + * image type. Returns the error code if not matched */ - if (params.iflag) { - /* - * Extract the data files from within the matched - * image type. Returns the error code if not matched - */ - retval = dumpimage_extract_subimage(tparams, ptr, - &sbuf); - } else { - /* - * Print the image information for matched image type - * Returns the error code if not matched - */ - retval = imagetool_verify_print_header(ptr, &sbuf, - tparams, ¶ms); - } - - (void)munmap((void *)ptr, sbuf.st_size); - (void)close(ifd); - - return retval; + retval = dumpimage_extract_subimage(tparams, ptr, &sbuf); + } else { + /* + * Print the image information for matched image type + * Returns the error code if not matched + */ + retval = imagetool_verify_print_header(ptr, &sbuf, tparams, + ¶ms); } + (void)munmap((void *)ptr, sbuf.st_size); (void)close(ifd); - return EXIT_SUCCESS; + return retval; } static void usage(void) From patchwork Sat Jan 26 02:31:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1031372 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43mg1261wgz9s7T for ; Sat, 26 Jan 2019 13:33:10 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 7B8FCC21E1A; Sat, 26 Jan 2019 02:32:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D5D1BC21E02; Sat, 26 Jan 2019 02:32:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 02127C21CB6; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id A8A51C21D65 for ; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from hades.home (unknown [IPv6:2a00:23c5:58d:db00:68bb:47d:d5ca:9abd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 5AA9A27D67D; Sat, 26 Jan 2019 02:32:04 +0000 (GMT) From: Martyn Welch To: Tom Rini Date: Sat, 26 Jan 2019 02:31:53 +0000 Message-Id: <20190126023154.19749-4-martyn.welch@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126023154.19749-1-martyn.welch@collabora.com> References: <20190126023154.19749-1-martyn.welch@collabora.com> MIME-Version: 1.0 Cc: Martyn Welch , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/5] tools: dumpimage: Add help option and make error paths consistent X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The utility dumpimage has error paths that display the usage and others that exit without displaying usage. Add an explicit help option to dumpimage to display the usage and remove it's use in error paths to make the error messages more obvious and errors paths more consistent. Signed-off-by: Martyn Welch --- tools/dumpimage.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/dumpimage.c b/tools/dumpimage.c index e17e979b04..5c9ad36322 100644 --- a/tools/dumpimage.c +++ b/tools/dumpimage.c @@ -65,7 +65,7 @@ int main(int argc, char **argv) params.cmdname = *argv; - while ((opt = getopt(argc, argv, "lo:T:p:V")) != -1) { + while ((opt = getopt(argc, argv, "hlo:T:p:V")) != -1) { switch (opt) { case 'l': params.lflag = 1; @@ -79,7 +79,7 @@ int main(int argc, char **argv) if (params.type < 0) { fprintf(stderr, "%s: Invalid type\n", params.cmdname); - usage(); + exit(EXIT_FAILURE); } break; case 'p': @@ -94,15 +94,20 @@ int main(int argc, char **argv) case 'V': printf("dumpimage version %s\n", PLAIN_VERSION); exit(EXIT_SUCCESS); + case 'h': + usage(); default: usage(); break; } } + if (argc < 2) + usage(); + if (optind >= argc) { fprintf(stderr, "%s: image file missing\n", params.cmdname); - usage(); + exit(EXIT_FAILURE); } params.imagefile = argv[optind]; @@ -123,7 +128,7 @@ int main(int argc, char **argv) if (tparams->check_params(¶ms)) { fprintf(stderr, "%s: Parameter check failed\n", params.cmdname); - usage(); + exit(EXIT_FAILURE); } } @@ -195,9 +200,12 @@ static void usage(void) " -T ==> set image type to 'type'\n" " -p ==> 'position' (starting at 0) of the component to extract from image\n", params.cmdname); + fprintf(stderr, + " %s -h ==> print usage information and exit\n", + params.cmdname); fprintf(stderr, " %s -V ==> print version information and exit\n", params.cmdname); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); } From patchwork Sat Jan 26 02:31:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1031373 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43mg165N06z9s7T for ; Sat, 26 Jan 2019 13:33:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 6BCB2C21E30; Sat, 26 Jan 2019 02:32:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 51CE0C21DF3; Sat, 26 Jan 2019 02:32:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3D07EC21CB6; Sat, 26 Jan 2019 02:32:05 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id EFF0EC21D83 for ; Sat, 26 Jan 2019 02:32:04 +0000 (UTC) Received: from hades.home (unknown [IPv6:2a00:23c5:58d:db00:68bb:47d:d5ca:9abd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: martyn) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id AB17D26070C; Sat, 26 Jan 2019 02:32:04 +0000 (GMT) From: Martyn Welch To: Tom Rini Date: Sat, 26 Jan 2019 02:31:54 +0000 Message-Id: <20190126023154.19749-5-martyn.welch@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126023154.19749-1-martyn.welch@collabora.com> References: <20190126023154.19749-1-martyn.welch@collabora.com> MIME-Version: 1.0 Cc: Martyn Welch , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 5/5] tools: dumpimage: Clarify help X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Help message isn't clear over the use of the "-T" option (it's to declare the type of image that the tool is operating on), which also is optional as it defaults to the default image type. It's also missing a description of the "-o" option, so add it. Signed-off-by: Martyn Welch --- tools/dumpimage.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/dumpimage.c b/tools/dumpimage.c index 5c9ad36322..ee3d41dda4 100644 --- a/tools/dumpimage.c +++ b/tools/dumpimage.c @@ -196,9 +196,10 @@ static void usage(void) " -l ==> list image header information\n", params.cmdname); fprintf(stderr, - " %s -T type [-p position] [-o outfile] image\n" - " -T ==> set image type to 'type'\n" - " -p ==> 'position' (starting at 0) of the component to extract from image\n", + " %s [-T type] [-p position] [-o outfile] image\n" + " -T ==> declare image type as 'type'\n" + " -p ==> 'position' (starting at 0) of the component to extract from image\n" + " -o ==> extract component to file 'outfile'\n", params.cmdname); fprintf(stderr, " %s -h ==> print usage information and exit\n",