From e3cbda91f4a1a844bc8edb5b5240b18f8261a6df Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 19 Sep 2017 19:53:19 -0700 Subject: [PATCH] wimlib-imagex: print version of library being used --- programs/imagex.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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); } -- 2.43.0