From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _dict
Date: Tue, 12 Dec 2000 22:03:56 -0500 [thread overview]
Message-ID: <20001212220356.A8293@dman.com> (raw)
Here's completion for dict. What's missing are completions for
-s and -d (which can be based on the results of -S and -D respectively)
Index: Completion/User/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/.distfiles,v
retrieving revision 1.12
diff -u -r1.12 .distfiles
--- Completion/User/.distfiles 2000/08/01 12:32:27 1.12
+++ Completion/User/.distfiles 2000/12/13 02:49:30
@@ -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
Index: Completion/User/_dict
===================================================================
RCS file: _dict
diff -N _dict
--- /dev/null Tue May 5 13:32:27 1998
+++ _dict Tue Dec 12 18:49:30 2000
@@ -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'
reply other threads:[~2000-12-13 3:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20001212220356.A8293@dman.com \
--to=schizo@debian.org \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).