Skip to content
Snippets Groups Projects
Commit 79aa33cd authored by Baruch Siach's avatar Baruch Siach Committed by Tom Rini
Browse files

mkimage: fix display of image types list


Since commit 5b9d44df (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: default avatarBaruch Siach <baruch@tkos.co.il>
parent 3690cbd6
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,7 @@ static void usage(const char *msg) ...@@ -113,7 +113,7 @@ static void usage(const char *msg)
#endif #endif
fprintf(stderr, " %s -V ==> print version information and exit\n", fprintf(stderr, " %s -V ==> print version information and exit\n",
params.cmdname); 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); exit(EXIT_FAILURE);
} }
...@@ -260,6 +260,10 @@ static void process_args(int argc, char **argv) ...@@ -260,6 +260,10 @@ static void process_args(int argc, char **argv)
params.skipcpy = 1; params.skipcpy = 1;
break; break;
case 'T': case 'T':
if (strcmp(optarg, "list") == 0) {
show_valid_options(IH_TYPE);
exit(EXIT_SUCCESS);
}
type = genimg_get_type_id(optarg); type = genimg_get_type_id(optarg);
if (type < 0) { if (type < 0) {
show_valid_options(IH_TYPE); show_valid_options(IH_TYPE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment