diff --git a/programs/zstd.1.md b/programs/zstd.1.md index 22f7d0425..4b3818141 100644 --- a/programs/zstd.1.md +++ b/programs/zstd.1.md @@ -164,7 +164,8 @@ the last one takes effect. * `--format=FORMAT`: compress and decompress in other formats. If compiled with support, zstd can compress to or decompress from other compression algorithm - formats. Possibly available options are `gzip`, `xz`, `lzma`, and `lz4`. + formats. Possibly available options are `zstd`, `gzip`, `xz`, `lzma`, and `lz4`. + If no such format is provided, `zstd` is the default. * `-h`/`-H`, `--help`: display help/long help and exit * `-V`, `--version`: diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 28bfdc539..0fa7ef325 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -145,6 +145,7 @@ static int usage_advanced(const char* programName) #ifdef UTIL_HAS_CREATEFILELIST DISPLAY( " -r : operate recursively on directories \n"); #endif + DISPLAY( "--format=zstd : compress files to the .zstd format (default) \n"); #ifdef ZSTD_GZCOMPRESS DISPLAY( "--format=gzip : compress files to the .gz format \n"); #endif @@ -500,6 +501,7 @@ int main(int argCount, const char* argv[]) if (!strcmp(argument, "--rm")) { FIO_setRemoveSrcFile(1); continue; } if (!strcmp(argument, "--priority=rt")) { setRealTimePrio = 1; continue; } if (!strcmp(argument, "--single-thread")) { nbWorkers = 0; singleThread = 1; continue; } + if (!strcmp(argument, "--format=zstd")) { suffix = ZSTD_EXTENSION; FIO_setCompressionType(FIO_zstdCompression); continue; } #ifdef ZSTD_GZCOMPRESS if (!strcmp(argument, "--format=gzip")) { suffix = GZ_EXTENSION; FIO_setCompressionType(FIO_gzipCompression); continue; } #endif diff --git a/tests/playTests.sh b/tests/playTests.sh index 200de4bd9..e0779ad2c 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -485,6 +485,12 @@ $ZSTD -bi0 --fast tmp1 $ECHO "with recursive and quiet modes" $ZSTD -rqi1b1e2 tmp1 +$ECHO "\n===> zstd compatibility tests " + +./datagen > tmp +rm -f tmp.zst +$ZSTD --format=zstd -f tmp +test -f tmp.zst $ECHO "\n===> gzip compatibility tests " @@ -522,6 +528,12 @@ else $ECHO "gzip mode not supported" fi +if [ $GZIPMODE -eq 1 ]; then + ./datagen > tmp + rm -f tmp.zst + $ZSTD --format=gzip --format=zstd -f tmp + test -f tmp.zst +fi $ECHO "\n===> xz compatibility tests "