Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: _netcat



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 2>/dev/null) = *GNU* ]]; 
> +(( $+_cmd_variant )) || typeset -gA _cmd_variant
> +if (( ! $+_cmd_variant[$words[1]] )); then
> +  if [[ $(_call_program variant $words[1] --version </dev/null 2>/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@xxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author