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

Re: completion for rsync?

Anthony R Iano-Fletcher wrote:

> ...
> I removed the '&& ret=0'. I followed the recipe from another completion
> function... hence the extra cruft. Likewise I have some extra colons in
> the options.
> You mean something like:
> 	_wanted hosts expl 'host name' _hosts
> That does work better.....

No, just the simple:

 _arguments ... \ # option descriptions here
            '*:host name:_hosts'

and nothing below that.  But of course, that can only be a first try
at _rsync, given its complicated syntax, not all of which can be done
with _arguments. So there probably should be either a state handling
or a local utility function (called instead of the _hosts above) to
handle the `[user@]host:(:|)(src|dest)' syntax.  For some of this,
there are already utility functions, looking at how _ssh handles scp
might help here.

> I'm attaching the next version...... criticism is welcome.
> Do I still need this line?
> > > local expl hosts

With the change I described above: no.  In your version `expl' is
still used (second argument to _wanted).


Sven Wischnowsky                           wischnow@xxxxxxxxx

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