zsh-users
 help / color / mirror / code / Atom feed
From: Andy Spiegl <zsh.Andy@spiegl.de>
To: ZSH User List <zsh-users@sunsite.auc.dk>
Subject: trying completion of varying data
Date: Fri, 31 May 2002 22:50:25 -0500	[thread overview]
Message-ID: <20020531225024.A17033@radiomaranon.org.pe> (raw)

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)


             reply	other threads:[~2002-06-01  3:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-01  3:50 Andy Spiegl [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020531225024.A17033@radiomaranon.org.pe \
    --to=zsh.andy@spiegl.de \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).