From: Simon Josefsson Date: Sun, 6 Aug 2006 15:20:08 +0000 (+0000) Subject: Support --version. X-Git-Tag: gnutls_1_4_2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fb137c3458834ebfb0aa4366476a36f79a4cedd;p=thirdparty%2Fgnutls.git Support --version. --- diff --git a/src/tls_test.c b/src/tls_test.c index 29fb1ba6ec..7c2d53d73a 100644 --- a/src/tls_test.c +++ b/src/tls_test.c @@ -334,3 +334,13 @@ gaa_parser (int argc, char **argv) verbose = info.more_info; } + +void +tls_test_version (void) +{ + const char *v = gnutls_check_version (NULL); + + printf ("gnutls-cli-debug (GnuTLS) %s\n", LIBGNUTLS_VERSION); + if (strcmp (v, LIBGNUTLS_VERSION) != 0) + printf ("libgnutls %s\n", v); +} diff --git a/src/tls_test.gaa b/src/tls_test.gaa index b72febd900..1d26464f8f 100644 --- a/src/tls_test.gaa +++ b/src/tls_test.gaa @@ -7,6 +7,8 @@ # include #endif +void tls_test_version(void); + #} helpnode "GNU TLS debug client\nUsage: gnutls-cli-debug [options] hostname\n\n" @@ -20,6 +22,7 @@ option (d, debug) INT "integer" { $debug = $1 } "Enable debugging" #int more_info; option (v, verbose) { $more_info += 1 } "More verbose output" +option (v, version) { tls_test_version(); exit(0); } "prints the program's version number" option (h, help) { gaa_help(); exit(0); } "prints this help"