From: Simon Glass Date: Thu, 30 Jun 2016 16:52:19 +0000 (-0600) Subject: mkimage: Show item lists for all categories X-Git-Tag: v2016.09-rc1~114 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=51f03e6a7596d61a9ae9b1aee030112cc6a795ff;p=u-boot mkimage: Show item lists for all categories Update the error-handling code for -A, -C and -O to show a list of valid options when an invalid one is provided. Signed-off-by: Simon Glass Reported-by: Vinoth Eswaran Reviewed-by: Tom Rini --- diff --git a/tools/mkimage.c b/tools/mkimage.c index 3cdbb2cfcd..f589a418ee 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -152,8 +152,10 @@ static void process_args(int argc, char **argv) break; case 'A': params.arch = genimg_get_arch_id(optarg); - if (params.arch < 0) + if (params.arch < 0) { + show_valid_options(IH_ARCH); usage("Invalid architecture"); + } break; case 'b': if (add_content(IH_TYPE_FLATDT, optarg)) { @@ -168,8 +170,10 @@ static void process_args(int argc, char **argv) break; case 'C': params.comp = genimg_get_comp_id(optarg); - if (params.comp < 0) + if (params.comp < 0) { + show_valid_options(IH_COMP); usage("Invalid compression type"); + } break; case 'd': params.datafile = optarg; @@ -216,8 +220,10 @@ static void process_args(int argc, char **argv) break; case 'O': params.os = genimg_get_os_id(optarg); - if (params.os < 0) + if (params.os < 0) { + show_valid_options(IH_OS); usage("Invalid operating system"); + } break; case 'p': params.external_offset = strtoull(optarg, &ptr, 16);