zsh-users
 help / color / mirror / code / Atom feed
From: Eric Mangold <teratorn@world-net.net>
To: "zsh-users@sunsite.dk" <zsh-users@sunsite.dk>
Subject: Re: completion help
Date: Sat, 14 Feb 2004 16:31:04 -0700	[thread overview]
Message-ID: <opr3dvl2nmi4eeqj@mail.oaktech.net> (raw)
In-Reply-To: <1076789362.2984.181046220@webmail.messagingengine.com>

On Sat, 14 Feb 2004 15:09:22 -0500, Dwight Shih <zshlist@ideoplex.com> 
wrote:

> 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 could easily be way off on this but I think you want to use "sets". See 
the _arguments documentation.

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

The _files documentation explains this. You want to use the -g argument as 
in:
_files -g "*.xml"


	-Eric



  reply	other threads:[~2004-02-15  0:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-14 20:09 Dwight Shih
2004-02-14 23:31 ` Eric Mangold [this message]
2007-04-14 14:08 Michael Drzal
2007-04-15 18:57 ` 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=opr3dvl2nmi4eeqj@mail.oaktech.net \
    --to=teratorn@world-net.net \
    --cc=zsh-users@sunsite.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).