From: Chris Johnson <cjohnson@cs.utk.edu>
To: zsh-users@sunsite.dk
Subject: Re: users@hosts completion
Date: Tue, 29 Jun 2004 17:39:28 -0400 [thread overview]
Message-ID: <20040629213928.GA5554@red-hots.cs.utk.edu> (raw)
In-Reply-To: <Pine.LNX.4.60.0406271006450.19831@toltec.zanshin.com>
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@cs.utk.edu
http://www.cs.utk.edu/~cjohnson
prev parent reply other threads:[~2004-06-29 21:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-27 12:15 Chris Johnson
2004-06-29 16:40 ` Bart Schaefer
2004-06-29 21:39 ` Chris Johnson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040629213928.GA5554@red-hots.cs.utk.edu \
--to=cjohnson@cs.utk.edu \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).