From: Tobias Hieta Date: Mon, 8 Jun 2020 12:06:37 +0000 (+0200) Subject: Short version string output X-Git-Tag: v1.4.7~140^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1cce9a6ad6e2ffe6c6a4eb731d28cd68893e450;p=thirdparty%2Fzstd.git Short version string output This adds support for just showing the version string without the full welcome message if the log level is less than the default. That means that you pass -q once and you will just see "1.4.5". This makes it easier to parse in scripts. --- diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 70e2b7066..6b795bb68 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -544,6 +544,11 @@ static unsigned parseCompressionParameters(const char* stringPtr, ZSTD_compressi static void printVersion(void) { + if (g_displayLevel < DISPLAY_LEVEL_DEFAULT) { + DISPLAYOUT("%s\n", ZSTD_VERSION_STRING); + return; + } + DISPLAYOUT(WELCOME_MESSAGE); if (g_displayLevel >= 3) { /* format support */