zsh-users
 help / color / mirror / code / Atom feed
* Tab Completion Question.
@ 2003-08-26 19:49 zak
  2003-08-26 21:09 ` zak
  0 siblings, 1 reply; 2+ messages in thread
From: zak @ 2003-08-26 19:49 UTC (permalink / raw)
  To: zsh-users


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@foo.bar

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@foo.bar)

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?"


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tab Completion Question.
  2003-08-26 19:49 Tab Completion Question zak
@ 2003-08-26 21:09 ` zak
  0 siblings, 0 replies; 2+ messages in thread
From: zak @ 2003-08-26 21:09 UTC (permalink / raw)
  To: zsh-users


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@mode3.com 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@foo.bar
> 
> 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@foo.bar)
> 
> 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?"


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-26 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-26 19:49 Tab Completion Question zak
2003-08-26 21:09 ` zak

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).