All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] tools: dumpimage: Provide more feedback on error
@ 2019-01-26  2:31 Martyn Welch
  2019-01-26  2:31 ` [U-Boot] [PATCH 2/5] tools: dumpimage: Simplify arguments Martyn Welch
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Martyn Welch @ 2019-01-26  2:31 UTC (permalink / raw)
  To: 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 <martyn.welch@collabora.com>
---

 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(&params))
+		if (tparams->check_params(&params)) {
+			fprintf(stderr, "%s: Parameter check failed\n",
+				params.cmdname);
 			usage();
+		}
 	}
 
 	if (params.iflag)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-03  1:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-26  2:31 [U-Boot] [PATCH 1/5] tools: dumpimage: Provide more feedback on error Martyn Welch
2019-01-26  2:31 ` [U-Boot] [PATCH 2/5] tools: dumpimage: Simplify arguments Martyn Welch
2019-02-03  1:09   ` [U-Boot] [U-Boot,2/5] " Tom Rini
2019-01-26  2:31 ` [U-Boot] [PATCH 3/5] tools: dumpimage: Simplify internal logic Martyn Welch
2019-02-03  1:09   ` [U-Boot] [U-Boot, " Tom Rini
2019-01-26  2:31 ` [U-Boot] [PATCH 4/5] tools: dumpimage: Add help option and make error paths consistent Martyn Welch
2019-02-03  1:09   ` [U-Boot] [U-Boot, " Tom Rini
2019-01-26  2:31 ` [U-Boot] [PATCH 5/5] tools: dumpimage: Clarify help Martyn Welch
2019-02-03  1:09   ` [U-Boot] [U-Boot,5/5] " Tom Rini
2019-02-03  1:09 ` [U-Boot] [U-Boot, 1/5] tools: dumpimage: Provide more feedback on error Tom Rini

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.