about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-12-13 03:07:00 +0000
committerClint Adams <clint@users.sourceforge.net>2000-12-13 03:07:00 +0000
commit81185fe668de1a53f4632b3d185f41c11388501c (patch)
treeb4825f3a338e74544daa273bf8812f7c311e4079
parentf39af3954fa94f4a11718d173185cc200e6027b5 (diff)
downloadzsh-81185fe668de1a53f4632b3d185f41c11388501c.tar.gz
zsh-81185fe668de1a53f4632b3d185f41c11388501c.tar.xz
zsh-81185fe668de1a53f4632b3d185f41c11388501c.zip
13250: _dict completion
-rw-r--r--ChangeLog5
-rw-r--r--Completion/User/.distfiles2
-rw-r--r--Completion/User/_dict66
3 files changed, 72 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 78b9bf491..f27e791c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-12-13  Clint Adams  <schizo@debian.org>
+
+	* 13250: Completion/User/.distfiles, Completion/User/_dict:
+	completion for dict.
+
 2000-12-06  Peter Stephenson  <pws@csr.com>
 
 	* unposted: Src/jobs.c: rename waitjob() to zwaitjob() to avoid
diff --git a/Completion/User/.distfiles b/Completion/User/.distfiles
index 4e3cf8188..94e0b9e9e 100644
--- a/Completion/User/.distfiles
+++ b/Completion/User/.distfiles
@@ -1,7 +1,7 @@
 DISTFILES_SRC='
     .distfiles
     _a2ps _archie _arp _bison _bzip2 _chown _compress
-    _configure _cvs _dd _diff _diff_options _dir_list _dirs
+    _configure _cvs _dd _dict _diff _diff_options _dir_list _dirs
     _domains _dvi _enscript
     _find _finger _fakeroot _flex _gcc _gdb  _getconf _gprof _groups
     _gs _gv _gzip _hosts _imagemagick _ispell
diff --git a/Completion/User/_dict b/Completion/User/_dict
new file mode 100644
index 000000000..228603dbe
--- /dev/null
+++ b/Completion/User/_dict
@@ -0,0 +1,66 @@
+#compdef dict
+
+local expl dictresults dictwords j dict
+
+_dictwords() {
+
+[[ -z $words[CURRENT] ]] && return 1
+
+dictresults=(${${(f)${"$(dict -m $words[CURRENT])":gs/    
+  / /}}:#[0-9]*matches found})
+
+for j in ${dictresults}
+do
+dict=${j%%:*}
+dictwords=(${(z)j#*:})
+
+_wanted $dict expl "words from $dict" \
+  compadd -M 'm:{a-zA-Z}={A-Za-z} r:|=*' -a "$@" - dictwords
+done
+}
+
+_arguments \
+	'(--host)-h[host]:dict server:_hosts' \
+	'(-h)--host:dict server:_hosts' \
+	'(--port)-p[port]:service:' \
+	'(-p)--port:service:' \
+	'(--database)-d[database]:db name:' \
+	'(-d)--database:db name:' \
+	'(--match)-m[match]' \
+	'(-m)--match' \
+	'(--strategy)-s[strategy]:strategy:' \
+	'(-s)--strategy:strategy:' \
+	'(--nocorrect)-C[nocorrect]' \
+	'(-C)--nocorrect' \
+	'(--config)-c[config]:config file:_files' \
+	'(-c)--config:config file:_files' \
+	'(--dbs)-D[list dbs]' \
+	'(-D)--dbs' \
+	'(--strats)-S[strats]' \
+	'(-S)--strats' \
+	'(--serverhelp)-H[server help]' \
+	'(-H)--serverhelp' \
+	'(--info)-i[db info]:db name:' \
+	'(-i)--info:db name:' \
+	'(--noauth)-a[disable authentication]' \
+	'(-a)--noauth' \
+	'(--user)-u[user]:user name:' \
+	'(-u)--user:user name:' \
+	'(--key)-k[key]:shared secret:' \
+	'(-k)--key:shared secret:' \
+	'(--version)-V[display version]' \
+	'(-V)--version' \
+	'(--license)-L[display license]' \
+	'(-L)--license' \
+	'--help' \
+	'(--verbose)-v[be verbose]' \
+	'(-v)--verbose' \
+	'(--raw)-r[be very verbose]' \
+	'(-r)--raw' \
+	'(--pager)-P[pager]:program:_command_names -e' \
+	'(-P)--pager:_command_names -e:' \
+	'--html' \
+	'--pipesize:buffer size:' \
+	'--client:client text:' \
+	'--debug:debug flag:(verbose raw scan parse pipe serial time)' \
+	':word:_dictwords'