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

Re: Completion



On Feb 15,  9:42am, Claus Alboege wrote:
> Subject: Completion
> 
> Could anyone tell me how to make zsh (3.1.6-*) complete in this fasion:
> 
> ssh <hostname from hostlist> -l <username from userlist>

I'm really surprized no one else has answered this yet ...

zstyle '*:my-accounts' users-hosts tractrix:kom.auc.dk ...

where ... are more strings of the form user:host, will set up zsh's idea
of the accounts that are "you".  These get used for ssh, rsh, and several
other commands that take user, host, or user@host arguments.

You can be more specific if you want:

zstyle '*:ssh:*:my-accounts' users-hosts tractrix:kom.auc.dk ...
zstyle '*:rsh:*:my-accounts' users-hosts alboege:fictitious.com ...

There are also styles that are lists of hosts, users, other-accounts, etc.,
but you can cover most of the cases for ssh with just this one.



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