From 9f9b6e165516c4ee59b1f5b609a6890ccc3d598f Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Fri, 5 May 2000 13:38:45 +0000 Subject: completion function cleanup for `_arguments' with the `-C' option and using it's return value (11195) --- Completion/X/_xauth | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'Completion/X') diff --git a/Completion/X/_xauth b/Completion/X/_xauth index 9461ac889..d702e5f0a 100644 --- a/Completion/X/_xauth +++ b/Completion/X/_xauth @@ -1,6 +1,6 @@ #compdef xauth -local state context line expl +local state context line expl ret=1 typeset -A opt_args local tmp cmd @@ -10,7 +10,7 @@ _arguments -s \ '(-v)-q[quiet mode]' \ '-b[break locks]' \ '-i[ignore locks]' \ - '*::command:->command' + '*::command:->command' && ret=0 while [[ -n "$state" ]]; do tmp="$state" @@ -27,7 +27,7 @@ while [[ -n "$state" ]]; do _arguments \ ':display name:->displayname' \ ':protocol name:->protocolname' \ - ':hexkey:' + ':hexkey:' && ret=0 ;; generate) @@ -42,7 +42,7 @@ while [[ -n "$state" ]]; do data) _message 'hexdata';; *) _wanted options expl 'xauth generate options' \ - compadd trusted untrusted timeout group data + compadd trusted untrusted timeout group data && ret=0 ;; esac fi @@ -50,7 +50,7 @@ while [[ -n "$state" ]]; do extract|nextract) case "$CURRENT" in - 2) _wanted files expl 'filename to write auth data' _files;; + 2) _wanted files expl 'filename to write auth data' _files && ret=0;; *) state=displayname;; esac ;; @@ -60,7 +60,7 @@ while [[ -n "$state" ]]; do ;; merge|nmerge) - _wanted files expl 'filename to read auth data' _files + _wanted files expl 'filename to read auth data' _files && ret=0 ;; remove) @@ -68,7 +68,7 @@ while [[ -n "$state" ]]; do ;; source) - _wanted files expl 'filename to source' _files + _wanted files expl 'filename to source' _files && ret=0 ;; info|exit|quit|\?) @@ -99,17 +99,19 @@ while [[ -n "$state" ]]; do 'help:print help' '?:list available commands' ) - _describe 'xauth command' tmp -- + _describe 'xauth command' tmp -- && ret=0 ;; protocolname) _wanted values expl 'authorization protocol' \ - compadd MIT-MAGIC-COOKIE-1 XDM-AUTHORIZATION-1 SUN-DES-1 MIT-KERBEROS-5 + compadd MIT-MAGIC-COOKIE-1 XDM-AUTHORIZATION-1 SUN-DES-1 MIT-KERBEROS-5 && ret=0 ;; displayname) - _wanted values expl 'display name' \ - compadd - ${${(f)"$(xauth list)"}%% *} || _x_display + { _wanted values expl 'display name' \ + compadd - ${${(f)"$(xauth list)"}%% *} || _x_display } && ret=0 ;; esac done + +return ret -- cgit 1.4.1