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

trying completion of varying data


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

           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)

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