Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Contributing with Completions
- X-seq: zsh-workers 23691
- From: Clint Adams <clint@xxxxxxx>
- To: Renato Botelho <rbgarga@xxxxxxxxx>
- Subject: Re: Contributing with Completions
- Date: Sun, 22 Jul 2007 07:34:55 -0400
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <747dc8f30707190601v40917b5erdeb07e604d5d5fb4@xxxxxxxxxxxxxx>
- Mail-followup-to: Renato Botelho <rbgarga@xxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <747dc8f30707180650k7159c9a5lb9c3b743cbab9506@xxxxxxxxxxxxxx> <200707190437.l6J4bcLG031432@xxxxxxxxxxxxxx> <747dc8f30707190601v40917b5erdeb07e604d5d5fb4@xxxxxxxxxxxxxx>
On Thu, Jul 19, 2007 at 10:01:34AM -0300, Renato Botelho wrote:
> _portsnap -> Tool for get/update FreeBSD ports tree using snapshots
>
> Comments, suggestions, critics are welcome, like I said, these are my
> first lines in zsh since i'm using it for less than a week.
When you use ->state, you should declare the scope of the parameters
context, state, line, opt_args.
Index: Completion/BSD/Command/_portsnap
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/BSD/Command/_portsnap,v
retrieving revision 1.1
diff -u -r1.1 _portsnap
--- Completion/BSD/Command/_portsnap 20 Jul 2007 16:39:15 -0000 1.1
+++ Completion/BSD/Command/_portsnap 22 Jul 2007 11:12:05 -0000
@@ -1,5 +1,8 @@
#compdef portsnap
+local context state line
+typeset -A opt_args
+
flags=(
'(cron)fetch[Fetch a compressed snapshot or update existing one]'
'(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]'
@@ -17,7 +20,7 @@
'-s:Server from which to fetch updates:_hosts' \
'*:principal:->principal' && ret=0
-if [[ $state = principal ]]; then
+if [[ $state == principal ]]; then
_alternative \
':file flag:_values -S " " -w "commands" $flags[@]' \
'*:path:_files -/'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author