summaryrefslogtreecommitdiff
path: root/src/tool_help.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-05-21 15:39:30 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-05-22 11:29:41 +0200
commite61d8e36d261b2caa915543d0593faa576164cb1 (patch)
treeca78c3c0150b25dd2b9fabff00a79385fb8664bc /src/tool_help.c
parentb4bed24459b69156faae9f2e323d78ffe8f5a245 (diff)
downloadcurl-e61d8e36d261b2caa915543d0593faa576164cb1.tar.gz
curl: include libmetalink version in --version output
Closes #7112
Diffstat (limited to 'src/tool_help.c')
-rw-r--r--src/tool_help.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tool_help.c b/src/tool_help.c
index 78c441e77..45f137f2a 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -23,10 +23,14 @@
#if defined(HAVE_STRCASECMP) && defined(HAVE_STRINGS_H)
#include <strings.h>
#endif
+#define ENABLE_CURLX_PRINTF
+/* use our own printf() functions */
+#include "curlx.h"
#include "tool_panykey.h"
#include "tool_help.h"
#include "tool_libinfo.h"
+#include "tool_metalink.h"
#include "tool_version.h"
#include "memdebug.h" /* keep this as LAST include */
@@ -963,11 +967,27 @@ featcomp(const void *p1, const void *p2)
#endif
}
+#ifdef USE_METALINK
+static const char *metalnk_version(void)
+{
+ static char version[25];
+ int major = 0;
+ int minor = 0;
+ int patch = 0;
+ metalink_get_version(&major, &minor, &patch);
+ msnprintf(version, sizeof(version), " libmetalink/%u.%u.%u",
+ major, minor, patch);
+ return version;
+}
+#else
+#define metalnk_version() ""
+#endif
+
void tool_version_info(void)
{
const char *const *proto;
- printf(CURL_ID "%s\n", curl_version());
+ printf(CURL_ID "%s%s\n", curl_version(), metalnk_version());
#ifdef CURL_PATCHSTAMP
printf("Release-Date: %s, security patched: %s\n",
LIBCURL_TIMESTAMP, CURL_PATCHSTAMP);