diff --git a/programs/zstd.1.md b/programs/zstd.1.md index 943eafb7..176a856c 100644 --- a/programs/zstd.1.md +++ b/programs/zstd.1.md @@ -238,6 +238,7 @@ the last one takes effect. display version number and exit. Advanced : `-vV` also displays supported formats. `-vvV` also displays POSIX support. + `-q` will only display the version number, suitable for machine reading. * `-v`, `--verbose`: verbose mode * `--show-default-cparams`: diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 70e2b706..6b795bb6 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 */