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

Re: Completing from different ssh config file



Jean-Rene David sent me the following 0.4K:

> I use the following function to log in to certain hosts:
> 
> foo() {
>    ssh -i ~/.ssh/id_rsa.foo \
>        -F ~/.ssh/config.foo \
>        "$*"
> }
> 
> How would I configure the completion system so
> that the hostname is completed from
> ~/.ssh/config.foo when I use this function?
> 
> Right now the hostname isn't completed at all
> because the context isn't recognized as a call to
> ssh.

For this last point, try:

   compdef foo=ssh

This causes zsh to employ ssh completion for foo.  This doesn't really
solve your problem, but I thought I'd share.  (Unless the completion for
ssh recognizes the -F option, in which case an alias may be more
appropriate?  I dunno.)

-- 
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson



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