Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion for rsync?
- X-seq: zsh-users 4614
- From: Sven Wischnowsky <wischnow@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: completion for rsync?
- Date: Wed, 23 Jan 2002 09:40:09 +0100
- In-reply-to: <20020122191915.GA25925@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020122191915.GA25925@xxxxxxxxxxxxxxxx>
Anthony R Iano-Fletcher wrote:
> ...
>
> #compdef fping
>
> local expl hosts
>
> _arguments -C \
> ...
> '-u[show targets that are unreachable]:' \
> && ret=0
Shouldn't the follwing be replaced by an argument-spec calling _hosts
(it's the same code anyway) and the `&& ret=0' be removed (it's not
defined as a local and not initialised to `1')?
> if ! zstyle -a ":completion:${curcontext}:hosts" hosts hosts; then
> (( $+_cache_hosts )) ||
> : ${(A)_cache_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
>
> hosts=( "$_cache_hosts[@]" )
> fi
>
> _wanted hosts expl host \
> compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "$@" -a hosts
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author