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/User/_socket | |
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/User/_socket')
-rw-r--r-- | Completion/User/_socket | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Completion/User/_socket b/Completion/User/_socket index 788113c28..9db31c9ae 100644 --- a/Completion/User/_socket +++ b/Completion/User/_socket @@ -5,7 +5,7 @@ # hosts-ports # The style that contains pairs `host:port'. -local curcontext="$curcontext" state line expl +local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args [[ $CURRENT -eq 2 ]] && @@ -25,30 +25,32 @@ _arguments -C -s \ '-l[loop]' \ '-p[program]:command:->command' \ ':arg1:->arg1' \ - ':arg2:->arg2' + ':arg2:->arg2' && ret=0 case "$state" in command) compset -q if [[ $CURRENT -eq 1 ]]; then - _command_names -e "$@" + _command_names -e "$@" && ret=0 else - _normal + _normal && ret=0 fi ;; arg1) if (( $+opt_args[-s] )); then - _ports + _ports && ret=0 else - _wanted hosts expl 'host' _combination '' hosts-ports hosts - + _wanted hosts expl 'host' _combination '' hosts-ports hosts - && ret=0 fi ;; arg2) if (( ! $+opt_args[-s] )); then _wanted ports expl 'port to connect' \ - _combination '' hosts-ports hosts="${line[1]:q}" ports - + _combination '' hosts-ports hosts="${line[1]:q}" ports - && ret=0 fi ;; esac + +return ret |