diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-05-23 17:06:14 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-05-23 17:06:14 +0200 |
commit | d168b89ab110a2d1fcaf72ad085a789092b82b00 (patch) | |
tree | fd0820a78ad5013da34cd7a137d28d678400a213 /sys/src/cmd/paqfs | |
parent | 33682347b9b3f8403d9db23b8ca7483ffe9f7767 (diff) |
mkpaqfs(8): allow setting compression level
Diffstat (limited to 'sys/src/cmd/paqfs')
-rw-r--r-- | sys/src/cmd/paqfs/mkpaqfs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/src/cmd/paqfs/mkpaqfs.c b/sys/src/cmd/paqfs/mkpaqfs.c index fbc91ee49..b29c944c0 100644 --- a/sys/src/cmd/paqfs/mkpaqfs.c +++ b/sys/src/cmd/paqfs/mkpaqfs.c @@ -33,6 +33,7 @@ void warn(char *fmt, ...); int uflag=0; /* uncompressed */ long blocksize = 4*1024; +int level = 6; Biobuf *out; DigestState *outdg; @@ -57,6 +58,10 @@ main(int argc, char *argv[]) if(label == nil) usage(); break; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + level = ARGC() - '0'; + break; case 'b': s = ARGF(); if(s) { @@ -105,7 +110,7 @@ main(int argc, char *argv[]) void usage(void) { - fprint(2, "usage: %s [-u] [-b blocksize] -o output [root]\n", argv0); + fprint(2, "usage: %s [-u] [-1-9] [-b blocksize] -o output [root]\n", argv0); exits("usage"); } @@ -370,7 +375,7 @@ writeBlock(uchar *b, int type) if(!uflag) { cb = emallocz(blocksize); - n = deflateblock(cb, blocksize, b, blocksize, 6, 0); + n = deflateblock(cb, blocksize, b, blocksize, level, 0); if(n > 0 && n < blocksize) { bh.encoding = DeflateEnc; bh.size = n; |