Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: users@hosts completion
- X-seq: zsh-users 7622
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: users@hosts completion
- Date: Tue, 29 Jun 2004 17:39:28 -0400
- In-reply-to: <Pine.LNX.4.60.0406271006450.19831@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040627121512.GC22418@xxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.60.0406271006450.19831@xxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> On Sun, 27 Jun 2004, Chris Johnson wrote:
>
> > How can I setup users-hosts completion for my specified commands?
>
> Unfortunately you can't set this up with zstyles only, because it relies
> on a special utility function called _combination which has to be called
> in the correct way from the function that generates potential matches for
> the command in question.
[...]
> If it happens that your command has argument syntax very similar to one of
> the commands that already uses users-hosts completion, then you can tell
> the completion system to treat completion for your command exactly the
> same as completion for that other command. You do that with a "compdef"
> command like so:
>
> compdef mynewcommand=telnet
This works beautifully. My command is just a wrapper to scp, written
to help prevent overwriting of files. Too many times I've omitted the
remote destination argument--i.e., scp source1 source2--and overwritten
source2 with source1. (I'm not aware of any interactive option for scp like there is for cp.)
So, this command lends itself perfectly to compdef. I am in your
debt. Thank you!
--
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author