aboutsummaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2017-06-29 20:37:08 +0300
committerTom Rini <trini@konsulko.com>2017-07-06 16:17:16 -0400
commit79aa33cdb3d2a158c5ccb35173cbd2ab084d8e9c (patch)
tree6283b5953765e1f65ca923329d0e889fb74912dc /tools/mkimage.c
parent3690cbd65e335463eddf40fb595302731c314297 (diff)
downloadu-boot-79aa33cdb3d2a158c5ccb35173cbd2ab084d8e9c.zip
u-boot-79aa33cdb3d2a158c5ccb35173cbd2ab084d8e9c.tar.gz
u-boot-79aa33cdb3d2a158c5ccb35173cbd2ab084d8e9c.tar.bz2
mkimage: fix display of image types list
Since commit 5b9d44df2307f (mkimage: Display a better list of available image types) mkimage usage text suggest to "use -T to see a list of available image types". Unfortunately, commit 02221f29deb8 (mkimage: Convert to use getopt()) broke that feature, because getopt() fails when -T has no option argument. Add a pseudo image type name 'list' that lists all image types. Update the usage text accordingly. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index d982bc5..28ff35e 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -113,7 +113,7 @@ static void usage(const char *msg)
#endif
fprintf(stderr, " %s -V ==> print version information and exit\n",
params.cmdname);
- fprintf(stderr, "Use -T to see a list of available image types\n");
+ fprintf(stderr, "Use '-T list' to see a list of available image types\n");
exit(EXIT_FAILURE);
}
@@ -260,6 +260,10 @@ static void process_args(int argc, char **argv)
params.skipcpy = 1;
break;
case 'T':
+ if (strcmp(optarg, "list") == 0) {
+ show_valid_options(IH_TYPE);
+ exit(EXIT_SUCCESS);
+ }
type = genimg_get_type_id(optarg);
if (type < 0) {
show_valid_options(IH_TYPE);