about summary refs log tree commit diff
path: root/Completion/Unix/Command/_netcat
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-14 23:03:40 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-14 23:04:45 +0200
commit13fc579343b24d298fb8905933b6000d7fcda114 (patch)
treecbc1000696357438714107635f93166bcab76d3a /Completion/Unix/Command/_netcat
parent66320ca93a717467a0ed0d34da4c06257953aa50 (diff)
downloadzsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.gz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.xz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.zip
33467: correct return status on functions and numerous other minor fixes
Diffstat (limited to 'Completion/Unix/Command/_netcat')
-rw-r--r--Completion/Unix/Command/_netcat19
1 files changed, 9 insertions, 10 deletions
diff --git a/Completion/Unix/Command/_netcat b/Completion/Unix/Command/_netcat
index 396fc8e09..4e4006b30 100644
--- a/Completion/Unix/Command/_netcat
+++ b/Completion/Unix/Command/_netcat
@@ -1,11 +1,10 @@
 #compdef nc netcat
 
-local curcontext="$curcontext" state line expl
-typeset -A opt_args
-
 # handle name clash with the nedit client
-[[ $service = nc ]] && ! _pick_variant netcat=connect nedit -h &&
-    _nedit && return
+if [[ $service = nc ]] && ! _pick_variant netcat=connect nedit -h; then
+  _nedit
+  return
+fi
 
 if (( ! $+_nc_args )); then
   local help="$(_call_program options $words[1] -h < /dev/null 2>&1)"
@@ -14,17 +13,17 @@ if (( ! $+_nc_args )); then
     '*-e prog*' '-e+[program to exec after connect]:prog:_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]:secs:'
+     '*-i secs*' '-i+[delay interval for lines sent or ports scanned]:delay (secs)'
      '*-l*' '-l[listen mode]'
      '*-n*' '-n[numeric-only IP addresses, no DNS]'
      '*-o file*' '-o+[hex dump of traffic]:file:_files'
      '*-p port*' '-p+[local port number]:port:_ports'
      '*-r*' '-r[randomize local and remote ports]'
-     '*-q secs*' '-q+[quit after EOF on stdin and delay of secs]:secs:'
+     '*-q secs*' '-q+[quit after EOF on stdin and delay of secs]:delay (secs)'
      '*-t*' '-t[answer TELNET negotiation]'
      '*-u*' '-u[UDP mode]'
      '*-v*' '-v[verbose]'
-     '*-w secs*' '-w+[timeout for connects and final net reads]:secs:'
+     '*-w secs*' '-w+[timeout for connects and final net reads]:timeout (secs)'
      '*-z*' '-z[zero-I/O mode]'
      '*-x*' '-x'
      '*-b*' '-b[allow broadcasts]'
@@ -32,7 +31,7 @@ if (( ! $+_nc_args )); then
   _nc_args=($optionmap[(K)"$help"])
 fi
 
-_arguments -C -s \
+_arguments -s \
   "$_nc_args[@]" \
   ':host:_hosts' \
-  ':port:_ports' && return 0
+  ':port:_ports'