diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-05 13:38:45 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-05 13:38:45 +0000 |
commit | 9f9b6e165516c4ee59b1f5b609a6890ccc3d598f (patch) | |
tree | 86460ad1a9886e6030fc1b1d1aee57668f28aa01 /Completion/X | |
parent | 04118530d4157d3494349e2628246b78465e08f8 (diff) | |
download | zsh-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/X')
-rw-r--r-- | Completion/X/_xauth | 24 |
1 files changed, 13 insertions, 11 deletions
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 |