mkimage: fix display of image types list
PATCH v2 1/1 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.
---
v2: Use 'list' pseudo type instead of getopt() optional argument
--- tools/mkimage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/mkimage.c +5 -1
@@ -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 );
Signature · 1 line
2.11.0
PATCH v2 1/1 mkimage: fix display of image types list
Quoted 8 lines · Baruch Siach
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, commit02221f29deb8(mkimage: Convert to usegetopt()) broke that feature, becausegetopt()fails when -T has no option argument.Add a pseudo image type name 'list' that lists all image types. Update the usage text accordingly.
Quoted 7 lines
Cc Simon Glass <[email protected]>Signed-off-by Baruch Siach <[email protected]>---
v2: Use 'list' pseudo type instead ofgetopt()optional argument--- tools/mkimage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
PATCH v2 1/1 mkimage: fix display of image types list
In reply to Baruch SiachQuoted 10 lines · Baruch Siach
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, commit02221f29deb8(mkimage: Convert to usegetopt()) broke that feature, becausegetopt()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 <[email protected]>Signed-off-by Baruch Siach <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170707/7bd257df/attachment.sig>