From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18696 invoked from network); 13 Mar 2002 08:33:00 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Mar 2002 08:33:00 -0000 Received: (qmail 6502 invoked by alias); 13 Mar 2002 08:32:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16818 Received: (qmail 6489 invoked from network); 13 Mar 2002 08:32:49 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15503.3721.373253.225908@wischnow.berkom.de> Date: Wed, 13 Mar 2002 09:32:09 +0100 To: zsh-workers@sunsite.dk Subject: Re: PATCH: _netcat In-Reply-To: <20020312173831.GA30789@logica.com> References: <1020310222552.ZM26165@candle.brasslantern.com> <20020311112606.GA20670@logica.com> <20020312173831.GA30789@logica.com> X-Mailer: VM 6.95 under 21.5 (patch 3) "asparagus" XEmacs Lucid Oliver Kiddle wrote: > ... > > Below is a suggested patch which I won't commit without a positive > reponse first. Any alternate suggestions to the parameter name > _cmd_variant and the tag name variant particularly welcome. Is it unwise > to change the existing use of the tag `version' - I'd be suprised > if anyone has configured this in a style. 1) I like the change because it's more extensible. 2) Can't help you with a better name, sorry. 3) I don't worry to much about the tag-name change either. > ... > > local expl curcontext="$curcontext" state line codeset LOCPATH > > -(( $+_is_gnu )) || typeset -gA _is_gnu > -if (( ! $+_is_gnu[$words[1]] )); then > - if [[ $(_call_program version $words[1] --version /dev/null) = *GNU* ]]; > +(( $+_cmd_variant )) || typeset -gA _cmd_variant > +if (( ! $+_cmd_variant[$words[1]] )); then > + if [[ $(_call_program variant $words[1] --version /dev/null) = *GNU* ]]; > then > - _is_gnu[$words[1]]=yes > + _cmd_variant[$words[1]]=gnu > else > - _is_gnu[$words[1]]= > + _cmd_variant[$words[1]]= > fi > fi Hm, some kind of helper-function for this? > -if [[ -n "$_is_gnu[$words[1]]" ]]; then > +if [[ -n "$_cmd_variant[$words[1]]" ]]; then I'm confused. Shoudn't this test `"$_cmd_variant[$words[1]]" = gnu'? As you do in: > ... > + [[ $_cmd_variant[$words[1]] = nedit ]] && _nedit And, btw., on this Suse-box: % which netcat /usr/bin/netcat And nc is the nedit-thing. (You asked for this, right? OR was it someone else?) Bye Sven -- Sven Wischnowsky wischnow@berkom.de