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

Re: Tab Completion Question.



One of my co workers figured it out  :)  Some of you might be interested.

hosts=(foo.bar host1.foo.bar host2.foo.bar)
compctl -k hosts host ping
compctl -k hosts -x 'n[-1,@]' -k hosts -- ssh 'ssh -A' scp


On Tue, 26 Aug 2003 zak@xxxxxxxxx wrote:

> 
> Is there a way to build pattern matching into compctl lists?
> 
> Here's what I'm trying to do.  In my .zshrc I have the following set.
> 
> hosts=(foo.bar)
> compctl -k hosts ssh 
> 
> I would like to be able to set the hosts variable to match for different
> usernames.  So that the following command would tab complete:
> 
> ssh root@xxxxxxx
> 
> I would imagine that you would do this by setting something like:
> 
> hosts=([root@]foo.bar)
> 
> but that doesn't work at all.  
> 
> Of course I can always set something like
> 
> hosts=(foo.bar root@xxxxxxx)
> 
> but in reality I have TONS of hosts listed for the hosts= variable and creating
> two entries for all of them would be a pain...  And eventually I would like to
> be able to automatically parse my DNS condiguration files for this list...
> 
> Any ideas?
> 
> Thanks!
> 
> 

-- 

Zak L Brown

Audio/Systems Engineer
www.mode3.com
www.insulinmusic.com

--


"How Did Our Oil Get Under Their Sand?"



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