summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_netcat
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-04-07 15:12:57 +0200
committerAxel Beckert <abe@deuxchevaux.org>2018-04-07 15:12:57 +0200
commit6e1ab9aa550695ee7e3d467b4173c0b83ba7f759 (patch)
tree8fb7faa4364a7cbf1cba48296a5f537e13f2a8d9 /Completion/Unix/Command/_netcat
parent5ad56a41f1ee2e61abca079f5ea8909f895ac2dd (diff)
parentf027f1d6e876708bc75d4217e1ca26898658d8d3 (diff)
downloadzsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.tar.gz
zsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.zip
Merge tag 'zsh-5.4.2-test-2' / 'upstream' branch into 'debian' branch
Test version 2 prior to zsh 5.5.
Diffstat (limited to 'Completion/Unix/Command/_netcat')
-rw-r--r--Completion/Unix/Command/_netcat9
1 files changed, 5 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_netcat b/Completion/Unix/Command/_netcat
index 4e4006b30..250d4c85d 100644
--- a/Completion/Unix/Command/_netcat
+++ b/Completion/Unix/Command/_netcat
@@ -6,11 +6,12 @@ if [[ $service = nc ]] && ! _pick_variant netcat=connect nedit -h; then
return
fi
-if (( ! $+_nc_args )); then
+if (( ! $#_cache_nc_args )); then
+ typeset -ga _cache_nc_args
local help="$(_call_program options $words[1] -h < /dev/null 2>&1)"
local -A optionmap
optionmap=(
- '*-e prog*' '-e+[program to exec after connect]:prog:_command_names -e'
+ '*-e prog*' '-e+[program to exec after connect]:program:_command_names -e'
'*-g gateway*' '-g+[source-routing hop point]:gateway:_hosts'
'*-G num*' '-G[source-routing pointer: 4, 8, 12]'
'*-i secs*' '-i+[delay interval for lines sent or ports scanned]:delay (secs)'
@@ -28,10 +29,10 @@ if (( ! $+_nc_args )); then
'*-x*' '-x'
'*-b*' '-b[allow broadcasts]'
)
- _nc_args=($optionmap[(K)"$help"])
+ _cache_nc_args=( $optionmap[(K)"$help"] )
fi
_arguments -s \
- "$_nc_args[@]" \
+ "$_cache_nc_args[@]" \
':host:_hosts' \
':port:_ports'