diff options
author | Werner Koch <[email protected]> | 2015-07-27 11:20:19 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-07-27 11:20:19 +0000 |
commit | d2e4bb4c77167a1ed10f1017a7d06a822bbd5135 (patch) | |
tree | fbee50f06d2c3b2b5c994bfe8e51a7eff6856eed | |
parent | Add new public macros for GCC attributes. (diff) | |
download | libgpg-error-d2e4bb4c77167a1ed10f1017a7d06a822bbd5135.tar.gz libgpg-error-d2e4bb4c77167a1ed10f1017a7d06a822bbd5135.zip |
Add option --lib-version to the gpg-error tool.
* src/gpg-error.c (main): Add new option.
-rw-r--r-- | src/gpg-error.c | 18 |
1 files 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")) |