about summary refs log tree commit diff
path: root/Completion/User/_archie
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-05 13:38:45 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-05 13:38:45 +0000
commit9f9b6e165516c4ee59b1f5b609a6890ccc3d598f (patch)
tree86460ad1a9886e6030fc1b1d1aee57668f28aa01 /Completion/User/_archie
parent04118530d4157d3494349e2628246b78465e08f8 (diff)
downloadzsh-9f9b6e165516c4ee59b1f5b609a6890ccc3d598f.tar.gz
zsh-9f9b6e165516c4ee59b1f5b609a6890ccc3d598f.tar.xz
zsh-9f9b6e165516c4ee59b1f5b609a6890ccc3d598f.zip
completion function cleanup for `_arguments' with the `-C' option and using it's return value (11195)
Diffstat (limited to 'Completion/User/_archie')
-rw-r--r--Completion/User/_archie23
1 files changed, 13 insertions, 10 deletions
diff --git a/Completion/User/_archie b/Completion/User/_archie
index 92551156e..103fd881a 100644
--- a/Completion/User/_archie
+++ b/Completion/User/_archie
@@ -1,13 +1,13 @@
 #compdef archie
 
-local state line
+local curcontext="$curcontext" state line expl
 typeset -A opt_args
 
-_arguments -s \
-  '-D[debug level]' \
+_arguments -C -s \
+  '-D+[debug level]:debug level:' \
   '-v[print version]' \
   '-V[verbose mode]' \
-  '-O[specifies offset]:offset:' \
+  '-O+[specifies offset]:offset:' \
   '-a[list matches as Alex filenames]' \
   '-c[case sensitive substring search]' \
   '-e[exact string match (default)]' \
@@ -15,16 +15,19 @@ _arguments -s \
   '-s[case insensitive substring search]' \
   '-l[list one match per line]' \
   '-t[sort inverted by date]' \
-  '-m[specifies maximum number of hits to return (default 95)]:hits to return:' \
-  '-o[specifies file to store results in]:file to store:' \
-  '-h[specifies server host]:server host:->serverhost' \
+  '-m+[specifies maximum number of hits to return (default 95)]:hits to return:' \
+  '-o+[specifies file to store results in]:file to store:' \
+  '-h+[specifies server host]:server host:->serverhost' \
   '-L[list known servers and current default]' \
   '-N-[specifies query niceness level (0-35765)]:niceness level:' \
-  ':string:'
+  ':string:' && return 0
 
 case "$state" in
 serverhost)
-  : ${(A)archie_servers:=${(M)$(archie -L):#archie.*}}
-  compadd $archie_servers
+  : ${(A)archie_servers:=${(M)$(_call hosts archie -L):#archie.*}}
+
+  _wanted hosts expl 'archie servers' compadd -  $archie_servers && return 0
   ;;
 esac
+
+return 1