summaryrefslogtreecommitdiff
path: root/Completion/User/_socket
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User/_socket')
-rw-r--r--Completion/User/_socket16
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