From 140f59d38e3d9b4009dada57939cb2d31048530c Mon Sep 17 00:00:00 2001 From: George Lu Date: Thu, 31 May 2018 15:29:35 -0700 Subject: [PATCH 1/5] Added --format=zstd title --- programs/zstdcli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 28bfdc539..f69e3d83a 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 \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 From 547096d67255e3ebd26910a3a9455c33d01fb154 Mon Sep 17 00:00:00 2001 From: George Lu Date: Thu, 31 May 2018 18:03:52 -0700 Subject: [PATCH 2/5] update man --- programs/zstd.1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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`: From 8984cc93d6b35ee9558c335a68070586cebf4d44 Mon Sep 17 00:00:00 2001 From: George Lu Date: Thu, 31 May 2018 18:04:05 -0700 Subject: [PATCH 3/5] update display --- programs/zstdcli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/zstdcli.c b/programs/zstdcli.c index f69e3d83a..0fa7ef325 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -145,7 +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 \n"); + 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 From cfc3451dcc6a98ed7c66284b6b9bd4be700e0ef2 Mon Sep 17 00:00:00 2001 From: George Lu Date: Fri, 1 Jun 2018 09:52:25 -0700 Subject: [PATCH 4/5] Added Test Case --- tests/playTests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/playTests.sh b/tests/playTests.sh index 200de4bd9..1433122ed 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -485,6 +485,11 @@ $ZSTD -bi0 --fast tmp1 $ECHO "with recursive and quiet modes" $ZSTD -rqi1b1e2 tmp1 +$ECHO "\n===> zstd compatibility tests " + +./datagen > tmp +$ZSTD --format=zstd tmp 2> tmplog +grep "zst" tmplog > $INTOVOID || die "--format=zstd not supported" $ECHO "\n===> gzip compatibility tests " From 41249bf34b5a4bba37834c03a0077497f5438d88 Mon Sep 17 00:00:00 2001 From: George Lu Date: Fri, 1 Jun 2018 10:54:51 -0700 Subject: [PATCH 5/5] Modified Tests Changed format as per suggestion and added second test --- tests/playTests.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/playTests.sh b/tests/playTests.sh index 1433122ed..e0779ad2c 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -488,8 +488,9 @@ $ZSTD -rqi1b1e2 tmp1 $ECHO "\n===> zstd compatibility tests " ./datagen > tmp -$ZSTD --format=zstd tmp 2> tmplog -grep "zst" tmplog > $INTOVOID || die "--format=zstd not supported" +rm -f tmp.zst +$ZSTD --format=zstd -f tmp +test -f tmp.zst $ECHO "\n===> gzip compatibility tests " @@ -527,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 "