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>
#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);
}
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);