From: Wolfgang Denk Date: Fri, 11 Feb 2011 23:41:43 +0100 Subject: [U-Boot] [PATCH v3] mkimage: add "-V" option to print version information In-Reply-To: <1297414591-12987-1-git-send-email-wd@denx.de> References: <1297414591-12987-1-git-send-email-wd@denx.de> Message-ID: <1297464103-9111-1-git-send-email-wd@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Wolfgang Denk --- v2: fix missing argument to printf() call. v3: explain the magic "+ 7" offset into the version string tools/mkimage.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/tools/mkimage.c b/tools/mkimage.c index f5859d7..febb536 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -23,6 +23,7 @@ #include "mkimage.h" #include +#include static void copy_file(int, const char *, int); static void usage(void); @@ -246,6 +247,14 @@ main (int argc, char **argv) case 'v': params.vflag++; break; + case 'V': + /* + * Skip the "U-Boot " part in + * U_BOOT_VERSION by adding 7 + */ + printf("mkimage version %s\n", + U_BOOT_VERSION + 7); + exit(EXIT_SUCCESS); case 'x': params.xflag++; break; @@ -590,6 +599,8 @@ usage () params.cmdname); fprintf (stderr, " %s [-D dtc_options] -f fit-image.its fit-image\n", params.cmdname); + fprintf (stderr, " %s -V ==> print version information and exit\n", + params.cmdname); exit (EXIT_FAILURE); } -- 1.7.4