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

Re: completion for rsync?



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