zsh-users
 help / color / mirror / code / Atom feed
* completion help
@ 2007-04-14 14:08 Michael Drzal
  2007-04-15 18:57 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Drzal @ 2007-04-14 14:08 UTC (permalink / raw)
  To: zsh-users

I apologize in advance if this question has been asked before and
answered, but I spent the last couple of days searching the web and
reading docs, and I came up empty handed.

I love the zsh completion system, but I'm having a little trouble
trying to figure out how to setup a specific completion.  I work in an
environment where hosts have DNS entries in multiple domains.  There
is one domain for normal host access, another domain for some form of
inband access (think DRAC on dells or SP/SC on sun hosts), and a third
for out of band access (serial console).  I would like to be able to
complete the domain name for various commands (ssh, ping, traceroute,
...).  I would envision something like:

% ssh host<TAB>
host host.regular host.inband host.outofband

I realize that I could enumerate all of the possible hosts with the
hosts style, but this seems like overkill.  Is there some way that I
could do something like:

zstyle context domains domain1 domain2 domain3 ...

and get the effect that I'm looking for?

  Mike


^ permalink raw reply	[flat|nested] 4+ messages in thread
* completion help
@ 2004-02-14 20:09 Dwight Shih
  2004-02-14 23:31 ` Eric Mangold
  0 siblings, 1 reply; 4+ messages in thread
From: Dwight Shih @ 2004-02-14 20:09 UTC (permalink / raw)
  To: Zsh users list

After years of avoidance, I've finally decided to start playing with
completion. Here's what I've got:

typeset -A opt_args
local contest state line

_arguments -s -S \
  "1:build:(build test start stop deploy validate help)" \
  "*:file:_files" \
  "-conf[specify configuration file]:file:_files" \
  "-a[automate deploy actions]" \
  "-f[force more or copy]" \
  "-m[move jar]" \
  "-c[copy jar]" \
  "-v(vv vvv)[validate output level 1]" \
  "-vv(v vvv)[validate output level 2]" \
  "-vvv(v vv)[validate output level 3]" \
  && return 0

which works as far as it goes.

What I would like to group options by major mode (the first set of
mutually exclusive options: build test start stop deploy validate and
help) so that only valid options for each mode would apply. So -a -f -m
-c would only apply in the deploy mode and -v -vv -vvv would only apply
in the validate mode.

I'd also like to restrict file completions. For example, I would like to
restrict the -conf file completion to be limited to *.xml and the general
file completion to be limited to *.jar.

Thanks for any help that you can provide.

Dwight Shih


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

end of thread, other threads:[~2007-04-15 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-14 14:08 completion help Michael Drzal
2007-04-15 18:57 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2004-02-14 20:09 Dwight Shih
2004-02-14 23:31 ` Eric Mangold

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