From: Eric Biggers Date: Wed, 20 Sep 2017 02:53:19 +0000 (-0700) Subject: wimlib-imagex: print version of library being used X-Git-Tag: v1.13.0~22 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=e3cbda91f4a1a844bc8edb5b5240b18f8261a6df wimlib-imagex: print version of library being used --- diff --git a/programs/imagex.c b/programs/imagex.c index 5e7dc6dd..28f02663 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -4520,9 +4520,11 @@ static const tchar *get_cmd_string(int cmd, bool only_short_form) static void version(void) { - static const tchar * const s = + uint32_t vers = wimlib_get_version(); + + static const tchar * const fmt = T( -"wimlib-imagex (distributed with " PACKAGE " " PACKAGE_VERSION ")\n" +"wimlib-imagex " PACKAGE_VERSION " (using wimlib %u.%u.%u)\n" "Copyright (C) 2012-2017 Eric Biggers\n" "License GPLv3+; GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" @@ -4530,7 +4532,8 @@ version(void) "\n" "Report bugs to "PACKAGE_BUGREPORT".\n" ); - tfputs(s, stdout); + tfprintf(stdout, fmt, + vers >> 20, (vers >> 10) & 0x3ff, vers & 0x3ff); }