about summary refs log tree commit diff
path: root/Completion/User/_bzip2
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2000-05-01 15:26:01 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2000-05-01 15:26:01 +0000
commitbfa1e274341d5e40b7dc9d0fb6935b58ceb9adf0 (patch)
tree2dc6e82f4cbc303f0f81e0718ff6f6e4795858b0 /Completion/User/_bzip2
parenta34e7272953c174141a0d0fa8933906c658b3714 (diff)
downloadzsh-bfa1e274341d5e40b7dc9d0fb6935b58ceb9adf0.tar.gz
zsh-bfa1e274341d5e40b7dc9d0fb6935b58ceb9adf0.tar.xz
zsh-bfa1e274341d5e40b7dc9d0fb6935b58ceb9adf0.zip
Use of _arguments in _bzip2 (11041)
Diffstat (limited to 'Completion/User/_bzip2')
-rw-r--r--Completion/User/_bzip258
1 files changed, 56 insertions, 2 deletions
diff --git a/Completion/User/_bzip2 b/Completion/User/_bzip2
index faf9f2501..545aa5fcc 100644
--- a/Completion/User/_bzip2
+++ b/Completion/User/_bzip2
@@ -1,3 +1,57 @@
-#compdef bzip2
+#compdef bzip2 bzcat bunzip2 bzip2recover
 
-_files -g '*~*.bz2'
+local decompress expl state line
+typeset -A opt_args
+
+case "${words[1]:t}" in
+  bzip2recover) [[ $CURRENT = 2 ]] && state=files;;
+  bzip2) decompress=no;&
+  bunzip2|bzcat) _arguments -C -s \
+    '(--help)-h[display help message]' \
+    '(-h)--help[display help message]' \
+    '(--decompress --compress -z --test -t)-d[decompress]' \
+    '(-d --compress -z --test -t)--decompress[decompress]' \
+    '(--compress --decompress -d --test -t)-z[compress]' \
+    '(-z --decompress -d --test -t)--compress[compress]' \
+    "(--keep)-k[keep (don't delete) input files]" \
+    "(-k)--keep[keep (don't delete) input files]" \
+    '(--force)-f[force overwrite]' \
+    '(-f)--force[force overwrite]' \
+    '(--test --decompress -d --compress -z )-t[test compressed file integrity]' \
+    '(-t --decompress -d --compress -z )--test[test compressed file integrity]' \
+    '(--stdout)-c[write on standard output]' \
+    '(-c)--stdout[write on standard output]' \
+    '(--quiet)-q[suppress all warnings]' \
+    '(-q)--quiet[suppress all warnings]' \
+    '(--verbose)*-v[verbose mode]' \
+    '(-v)*--verbose[verbose mode]' \
+    '(--license)-L[display software license]' \
+    '(-L)--license[display software license]' \
+    '(--version)-V[display version number]' \
+    '(-V)--version[display version number]' \
+    '(--small)-s[use less memory (at most 2500k)]' \
+    '(   -2 -3 -4 -5 -6 -7 -8 -9)-1' \
+    '(-1    -3 -4 -5 -6 -7 -8 -9)-2' \
+    '(-1 -2    -4 -5 -6 -7 -8 -9)-3' \
+    '(-1 -2 -3    -5 -6 -7 -8 -9)-4' \
+    '(-1 -2 -3 -4    -6 -7 -8 -9)-5' \
+    '(-1 -2 -3 -4 -5	-7 -8 -9)-6' \
+    '(-1 -2 -3 -4 -5 -6    -8 -9)-7' \
+    '(-1 -2 -3 -4 -5 -6 -7    -9)-8' \
+    '(-1 -2 -3 -4 -5 -6 -7 -8	)-9' \
+    '*:files:->files'
+  ;;
+esac
+
+if [[ "$state" = files ]]; then
+  (( $+opt_args[-z] || $+opt_args[--compress] )) && decompress=no
+  (( $+opt_args[-d] || $+opt_args[--decompress] || $+opt_args[-t] || \
+      $+opt_args[--test] )) && unset decompress
+  if [[ -z "$decompress" ]] ; then
+    _description files expl 'compressed file'
+    _files "$expl[@]" -g '*.bz2'
+  else
+    _description files expl 'file to compress'
+    _files "$expl[@]" -g '*~*.bz2'
+  fi
+fi