From d2e4bb4c77167a1ed10f1017a7d06a822bbd5135 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 27 Jul 2015 13:20:19 +0200 Subject: Add option --lib-version to the gpg-error tool. * src/gpg-error.c (main): Add new option. --- src/gpg-error.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gpg-error.c b/src/gpg-error.c index 672efe7..117b367 100644 --- a/src/gpg-error.c +++ b/src/gpg-error.c @@ -398,10 +398,20 @@ main (int argc, char *argv[]) { fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout); fputs ("Options:\n" - " --version Print version\n" - " --help Print this help\n" - " --list Print all error codes\n" - " --defines Print all error codes as #define lines\n", stdout); + " --version Print version\n" + " --lib-version Print library version\n" + " --help Print this help\n" + " --list Print all error codes\n" + " --defines Print all error codes as #define lines\n" + , stdout); + exit (0); + } + else if (argc == 2 && !strcmp (argv[1], "--lib-version")) + { + printf ("Version from header: %s (0x%06x)\n", + GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER); + printf ("Version from binary: %s\n", gpg_error_check_version (NULL)); + printf ("Copyright blurb ...:%s\n", gpg_error_check_version ("\x01\x01")); exit (0); } else if (argc == 2 && !strcmp (argv[1], "--list")) -- cgit v1.2.3