about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Unix/Command/_gzip63
-rw-r--r--Completion/Unix/Command/_zcat2
3 files changed, 41 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index ea9ebec5d..2aa3fb98b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-07-23  Oliver Kiddle <opk@zsh.org>
 
+	* 35866: Completion/Unix/Command/_gzip: complete also for pigz
+
+	* 35866: Completion/Unix/Command/_zcat: allow for NetBSD gzip
+
 	* 35824: Doc/Zsh/zle.yo, Src/Zle/iwidgets.list, Src/Zle/zle.h,
 	Src/Zle/zle_misc.c, Src/Zle/zle_refresh.c: allow highlighting of
 	just pasted text, put text from bracketed paste in cut buffers
diff --git a/Completion/Unix/Command/_gzip b/Completion/Unix/Command/_gzip
index 927d31d45..f9fd17819 100644
--- a/Completion/Unix/Command/_gzip
+++ b/Completion/Unix/Command/_gzip
@@ -1,37 +1,57 @@
-#compdef gzip gunzip gzcat=gunzip -redirect-,<,gunzip=gunzip -redirect-,>,gzip=gunzip -redirect-,<,gzip=gzip -value-,GZIP,-default-
+#compdef gzip gunzip gzcat=gunzip pigz unpigz -redirect-,<,gunzip=gunzip -redirect-,>,gzip=gunzip -redirect-,<,gzip=gzip -value-,GZIP,-default-
 
 local decompress files expl curcontext="$curcontext" state line ret=1
+local -a pigz
 typeset -A opt_args
+local excl="--decompress --uncompress -1 -2 -3 -4 -5 -6 -7 -8 -9 -11 --best"
 
 files=( '*:files:->files' )
 case "$service" in
+unpigz|pigz)
+  pigz=(
+    '(-K --zip)'{-K,--zip}'[compress to PKWare zip format]'
+    '(-b --blocksize)'{-b+,--blocksize}'[set compression block size]:size (KiB)'
+    '(-p --processes)'{-p,--processes}'[specify number of processes to use]'
+    '(-z --zlib)'{-z,--zlib}'[compress to zlib (.zz) format]'
+    '(-T --no-time)'{-T,--no-time}"[don't store/restore modification time in/from header]"
+  )
+;|
+pigz)
+  pigz+=(
+    '(-i --independent)'{-i,--independent}'[compress blocks independently to allow for damage recovery]'
+    "($excl)-11"
+    '(--rsyncable)-R[make rsync-friendly archive]'
+    "($excl)"{-F,--first}'[do iterations first, before block split]'
+    "($excl)"{-I+,--iterations}'[specify number of iterations for optimization]:iterations [15]'
+    "($excl)"{-M+,--maxsplits}'[specify maximum number of split blocks]:split blocks [15]'
+    "($excl)"{-O,--oneblock}"[don't split into smaller blocks]"
+  )
+;|
 *GZIP*)
   compset -q
   words=( fake "$words[@]" )
   (( CURRENT++ ))
   files=()
   ;&
-gunzip|zcat)
+gunzip|zcat|unpigz)
   decompress=yes
   ;&
-gzip)
+gzip|pigz)
   _arguments -C -s -S \
     '(--to-stdout --stdout)-c[write on standard output]' \
     '(-c --stdout)--to-stdout[write on standard output]' \
     '(-c --to-stdout)--stdout[write on standard output]' \
-    '(--decompress --uncompress)-d[decompress]' \
-    '(-d --uncompress)--decompress[decompress]' \
-    '(-d --decompress)--uncompress[decompress]' \
+    "($excl)"{-d,--decompress,--uncompress}'[decompress]' \
     '(--force)-f[force overwrite]' \
     '(-f)--force[force overwrite]' \
-    '(--help)-h[display help message]' \
-    '(-h)--help[display help message]' \
+    '(- *)'{-h,--help}'[display help message]' \
+    "(--keep)-k[don't delete input files]" \
+    "(-k)--keep[don't delete input files]" \
     '(--list)-l[list compressed file contents]' \
     '(-l)--list[list compressed file contents]' \
-    '(--license)-L[display software license]' \
-    '(-L)--license[display software license]' \
-    '(--no-name)-n[do not save or restore the original name and time stamp]' \
-    '(-n)--no-name[do not save or restore the original name and time stamp]' \
+    '(- *)'{-L,--license}'[display software license]' \
+    "(--no-name)-n[don't save or restore the original name and time stamp]" \
+    "(-n)--no-name[don't save or restore the original name and time stamp]" \
     '(--name)-N[save or restore the original name and time stamp]' \
     '(-N)--name[save or restore the original name and time stamp]' \
     '(--quiet --silent)-q[suppress all warnings]' \
@@ -39,27 +59,16 @@ gzip)
     '(-q --quiet)--silent[suppress all warnings]' \
     '(--recursive)-r[operate recursively on directories]' \
     '(-r)--recursive[operate recursively on directories]' \
-    '--rsyncable[make rsync-friendly archive]' \
+    '(-R)--rsyncable[make rsync-friendly archive]' \
     '(--suffix)-S+[specify suffix for compressed files]:suffix:' \
     '(-S)--suffix=[specify suffix for compressed files]:suffix:' \
     '(--test)-t[test compressed file integrity]' \
     '(-t)--test[test compressed file integrity]' \
     '(--verbose)-v[verbose mode]' \
     '(-v)--verbose[verbose mode]' \
-    '(--version)-V[display version number]' \
-    '(-V)--version[display version number]' \
-    '(       -1 -2 -3 -4 -5 -6 -7 -8 -9 --best)--fast' \
-    '(--fast    -2 -3 -4 -5 -6 -7 -8 -9 --best)-1' \
-    '(--fast -1    -3 -4 -5 -6 -7 -8 -9 --best)-2' \
-    '(--fast -1 -2    -4 -5 -6 -7 -8 -9 --best)-3' \
-    '(--fast -1 -2 -3    -5 -6 -7 -8 -9 --best)-4' \
-    '(--fast -1 -2 -3 -4    -6 -7 -8 -9 --best)-5' \
-    '(--fast -1 -2 -3 -4 -5    -7 -8 -9 --best)-6' \
-    '(--fast -1 -2 -3 -4 -5 -6    -8 -9 --best)-7' \
-    '(--fast -1 -2 -3 -4 -5 -6 -7    -9 --best)-8' \
-    '(--fast -1 -2 -3 -4 -5 -6 -7 -8    --best)-9' \
-    '(--fast -1 -2 -3 -4 -5 -6 -7 -8 -9       )--best' \
-    "$files[@]" && ret=0
+    '(- *)'{-V,--version}'[display version number]' \
+    "($excl)"-{-fast,1,2,3,4,5,6,7,8,9,-best} \
+    "$pigz[@]" "$files[@]" && ret=0
   ;;
 esac
 
diff --git a/Completion/Unix/Command/_zcat b/Completion/Unix/Command/_zcat
index 6dd4ecd7b..cf927507b 100644
--- a/Completion/Unix/Command/_zcat
+++ b/Completion/Unix/Command/_zcat
@@ -1,6 +1,6 @@
 #compdef zcat
 
-if _pick_variant gnu=GNU unix --license; then
+if _pick_variant gz='(GNU|NetBSD)' unix --license; then
   _gzip "$@"
 else
   _compress "$@"