From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2100 invoked from network); 10 Mar 2002 04:18:43 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Mar 2002 04:18:43 -0000 Received: (qmail 2286 invoked by alias); 10 Mar 2002 04:18:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16789 Received: (qmail 2274 invoked from network); 10 Mar 2002 04:18:37 -0000 Date: Sat, 9 Mar 2002 23:17:35 -0500 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: _netcat Message-ID: <20020310041735.GA15158@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i This is from Matt Zimmerman. He points out that nc conflicts with _nedit. On Debian this isn't an issue (nedit's nc is distributed as nedit-nc), so the compdef line in _nedit can be changed accordingly. Elsewhere, I can't think of a good solution. Index: Completion/Unix/Command/_netcat =================================================================== RCS file: Completion/Unix/Command/_netcat diff -N Completion/Unix/Command/_netcat --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Completion/Unix/Command/_netcat 10 Mar 2002 04:10:50 -0000 @@ -0,0 +1,34 @@ +#compdef nc netcat + +local curcontext="$curcontext" state line expl +typeset -A opt_args + +if (( ! $+_nc_args )); then + local help="$(_call_program options nc -h < /dev/null 2>&1)" + local -A optionmap + optionmap=( + '*-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:' + '*-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:' + '*-t*' '-t[answer TELNET negotiation]' + '*-u*' '-u[UDP mode]' + '*-v*' '-v[verbose]' + '*-w secs*' '-w+[timeout for connects and final net reads]:secs:' + '*-z*' '-z[zero-I/O mode]' + '*-x*' '-x' + '*-b*' '-b[allow broadcasts]' + ) + _nc_args=($optionmap[(K)"$help"]) +fi + +_arguments -C -s \ + "$_nc_args[@]" \ + ':host:_hosts' \ + ':port:_ports' && return 0