zsh-users
 help / color / mirror / code / Atom feed
* trying completion of varying data
@ 2002-06-01  3:50 Andy Spiegl
  2002-06-01 14:33 ` Clint Adams
  2002-06-01 20:26 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Spiegl @ 2002-06-01  3:50 UTC (permalink / raw)
  To: ZSH User List

Hi,

I am trying to write a completion rule for xvncviewer that only completes
the hosts that are actually turned on in my subnet.  So everytime before
showing me the possible completions it has to check for running hosts.
This second part isn't so hard, e.g. like this:

foreach ip (`nmblookup "*" | cut -f1 -d" " | grep "^[0-9.]*$"`) 
host $ip | grep Name: | cut -d" " -f2
end
 (sorry, I'm sure you guys would do that better and faster)

But then how do I get zsh to complete only these hostnames???
Looking at these working examples:
 zstyle ':completion:*:*:mpg123:*' file-patterns \
  '*.(mp3|MP3):mp3\ files *(-/):directories'

 zstyle ':completion:*:processes' command 'ps -au$USER'

I tried
 zstyle ':completion:*:*:xvncviewer:*' command 'show.active.pcs'
      (where show.active.pcs does the above)
but it doesn't even try to call the show.active.pcs script.

Please give me a hint what I'm doing wrong or any other suggestions.
Thanks!
 Andy.

-- 
           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "We're going to turn this team around 360 degrees."
      (Jason Kidd, upon his drafting to the Dallas Mavericks)


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

end of thread, other threads:[~2002-06-02  5:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-01  3:50 trying completion of varying data Andy Spiegl
2002-06-01 14:33 ` Clint Adams
2002-06-02  3:44   ` Andy Spiegl
2002-06-02  5:58     ` Bart Schaefer
2002-06-01 20:26 ` Bart Schaefer

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