dotnet compression/decompression tool
$ dotnet add package dotnet-compressorThis is the tool for compressing, archiving.
you can get binary from github release page. Once you download it and add executable permission, you can execute it.
if you want to use as dotnet global tool, do following steps.
dotnet tool install -g dotnet-compressor$HOME/.dotnet/tools to your PATHthe command's basic format is dcomp [kind] [verb(d or c)] [options].
you can get kind list by dcomp --help,
verb is c(compression) or d(decompression).
and you can get individual subcommand help is dcomp [kind] [verb] --help
you can manupilate ZIP by zip subcommand.
dir1 and output dir1.zip: dcomp zip c -b dir1 -o dir1.zip.dir1.zip into dir1: dcomp zip d -i dir1.zip -o dir1dir1 which has .txt extension: dcomp zip c -b dir1 -i '**/*.txt' -o dir1.zipdir1.zip which has .txt extension to dir1: dcomp zip d -i dir1.zip --include '**/*.txt' -o dir1dcomp zip c -e sjis -b dir1 -o dir1.zipdir1.zip and filename decoding as Shift-JIS: dcomp zip d -e sjis -i dir1.zip -o dir1abc: dcomp zip c -b dir1 -o dir1.zip -p abcabc: dcomp zip d -i dir1.zip -o dir1 -p abcdir1 and output dir1.tar: dcomp tar c -b dir1 -o dir1.tar.dir1.tar into dir1: dcomp tar d -i dir1.tar -o dir1dir1 and output to standard output: dcomp tar c -b dir1 > dir1.tardir1: cat dir1.tar | dcomp tar d -o dir1dir1 which has .txt extension: dcomp tar c -b dir1 -i '**/*.txt' -o dir1.tardir1.tar which has .txt extension to dir1: dcomp tar d -i '**/*.txt' -o dir1dcomp tar c -e sjis -b dir1 -o dir1.tardir1.tar and filename decoding as Shift-JIS: dcomp tar d -e sjis -i dir1.tar -o dir1dcomp tar c -b dir1 -o dir1.tar -pm ".*\.sh=755"test.txt and output to test.gz: dcomp gz c -i test.txt -o test.gztest.gz and output to test.txt: dcomp gz d -i test.gz -o test.txttest.txt and output to test.bz2: dcomp bz2 c -i test.txt -o test.bz2test.bz2 and output to test.txt: dcomp bz2 d -i test.bz2 -o test.txttest.txt and output to test.lz: dcomp lzip c -i test.txt -o test.lztest.lz and output to test.txt: dcomp lzip d -i test.bz2 -o test.txttest.xz and output to test.txt: dcomp xz d -i test.xz -o test.txtdir1 and compressing by gzip: dcomp tar c -b dir1 | dcomp gz c -o dir1.tgz
dcomp tar c -b dir1 -c gzip -o dir1.tgzdir1.tgz into dir1: dcomp gz d -i dir1.tgz|dcomp tar d -o dir1
dcomp tar d -i dir1.tgz -c gziptest.txt and output to test.zstd: dcomp zstd c -i test.txt -o test.zstdtest.zstd and output to test.txt: dcomp zstd d -i test.zstd -o test.txthere are prerequisits if you want to build native binary
dotnet tool restoredotnet cake
dotnet cake -Configuration=Release -IsReleaseand then you will get nupkg in dist/[Configuration]/nupkg, binary executable in src/dotnet-compressor/bin/[Debug or Release]/net10.0
if you want to get single executable binary, you should do following steps.
CppCompilerAndLinker=clang-[version] env value if you do not have clang-3.9 and build in linux or macos.dotnet cake -Target=Native -Runtime=[rid] -Configuration=[Debug or Release]and then you will get native executable binary in dist/native/[Debug or Release]/[rid]