Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
completion help
- X-seq: zsh-users 7056
- From: "Dwight Shih" <zshlist@xxxxxxxxxxxx>
- To: "Zsh users list" <zsh-users@xxxxxxxxxx>
- Subject: completion help
- Date: Sat, 14 Feb 2004 15:09:22 -0500
- In-reply-to: ARRAY(0xa0b208c)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: ARRAY(0xa175c60)
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author