about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-26 08:34:13 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-26 08:34:13 +0000
commit0c4eb61e906251971b1d4053365189f251cd18b6 (patch)
tree4757d00c3ae8a47d3a51e355549da6b290e6c7b7
parentf33678484656a91fdaa6502ca5c088c2062fec1b (diff)
downloadzsh-0c4eb61e906251971b1d4053365189f251cd18b6.tar.gz
zsh-0c4eb61e906251971b1d4053365189f251cd18b6.tar.xz
zsh-0c4eb61e906251971b1d4053365189f251cd18b6.zip
new completion for GNU zip from Tanaka (10890)
-rw-r--r--ChangeLog7
-rw-r--r--Completion/User/_gunzip3
-rw-r--r--Completion/User/_gzip83
3 files changed, 88 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e86e5a4a4..dd066357d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2000-04-26  Sven Wischnowsky  <wischnow@informatik.hu-berlin.de>
 
+	* Tanaka Akira: 10890: Completion/User/_gunzip,
+	Completion/User/_gzip, Completion/User/_zcat: new completion for
+	GNU zip commands
+
+	* Tanaka Akira: 10885: Completion/X/_xset: new completion function
+	for xset
+
 	* 10926: Completion/X/_x_color, Doc/Zsh/compwid.yo, Src/Zle/complete.c,
  	Src/Zle/compmatch.c: allow to anchor on gaps between strings in
  	matching control specs
diff --git a/Completion/User/_gunzip b/Completion/User/_gunzip
deleted file mode 100644
index 35a27e774..000000000
--- a/Completion/User/_gunzip
+++ /dev/null
@@ -1,3 +0,0 @@
-#defcomp gunzip zcat
-
-_files -g '*.[gG][z]'
diff --git a/Completion/User/_gzip b/Completion/User/_gzip
index 3cda1e4ed..e093788dc 100644
--- a/Completion/User/_gzip
+++ b/Completion/User/_gzip
@@ -1,3 +1,82 @@
-#defcomp gzip
+#compdef gzip gunzip gzcat
 
-_files -g '*~*.[gG][zZ]'
+local decompress
+local expl
+local curcontext="$curcontext" state line
+typeset -A opt_args
+
+case "${words[1]:t}" in
+gunzip|zcat|gzcat)
+  decompress=yes
+  ;&
+gzip)
+  _arguments -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]' \
+    '(--force)-f[force overwrite]' \
+    '(-f)--force[force overwrite]' \
+    '(--help)-h[display help message]' \
+    '(-h)--help[display help message]' \
+    '(--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]' \
+    '(--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]' \
+    '(-q --silent)--quiet[suppress all warnings]' \
+    '(-q --quiet)--silent[suppress all warnings]' \
+    '(--recursive)-r[operate recursively on directories]' \
+    '(-r)--recursive[operate recursively on directories]' \
+    '(--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:->files'
+  ;;
+esac
+
+case "$state" in
+files)
+  (( $+opt_args[-d] || $+opt_args[--decompress] || $+opt_args[--uncompress] )) &&
+    decompress=yes
+  if (( $+opt_args[-r] || $+opt_args[--recursive] )); then
+    if [[ -z "$decompress" ]]; then
+      _description directories expl 'directory to compress'
+      _files "$expl[@]" -/
+    else
+      _description directories expl 'compressed directory'
+      _files "$expl[@]" -/
+    fi
+  else
+    if [[ -z "$decompress" ]]; then
+      _description files expl 'file to compress'
+      _files "$expl[@]" -g '*~*.(([tT]|)[gG]|)[zZ]'
+    else
+      _description files expl 'compressed file'
+      _files "$expl[@]" -g '*.(([tT]|)[gG]|)[zZ]'
+    fi
+  fi
+  ;;
+esac