diff options
author | Martyn Welch <martyn.welch@collabora.com> | 2019-01-26 02:31:50 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-02-01 14:13:45 -0500 |
commit | 57a608e9694045c84ef63878c2bb57a30a0c6800 (patch) | |
tree | 0d25820b20bed1088413fd87a29d84ce0b018a64 /tools/dumpimage.c | |
parent | 3c29a5673617c8f03e0494febca310c2ea1f7ed9 (diff) |
tools: dumpimage: Provide more feedback on error
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>
Diffstat (limited to 'tools/dumpimage.c')
-rw-r--r-- | tools/dumpimage.c | 11 |
1 files 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) |