From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Q about _arguments
Date: Fri, 7 Apr 2000 14:41:32 +0200 (MET DST) [thread overview]
Message-ID: <200004071241.OAA24849@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Fri, 7 Apr 2000 16:07:26 +0400
Andrej Borsenkow wrote:
> In some cases description string for option values is not used. Example
> is (part of fetchmail completion - I'll send as soon it is complete -
> with trivial "_arguments ..." form):
>
> "(-m)--mda=[set MDA to use for forwarding]::mail delivery
> program:_command_names -e" \
>
> and
>
> bor@itsrm2% fetchmail --md=/to/b/p<TAB>
>
> results in
>
> bor@itsrm2% fetchmail --mda=/tools/bin/p
> Completing executable file or directory
>
> ...
>
> note, that I'd expect "Completing mail delivery program" here.
Hrm. That's because _command_names uses `_alternative -O' to give the
options it got to _alternative and that puts them at the beginning,
but then _all_labels puts the $expl[@] it builds even before that.
Bye
Sven
Index: Completion/Base/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_arguments,v
retrieving revision 1.3
diff -u -r1.3 _arguments
--- Completion/Base/_arguments 2000/04/05 12:06:31 1.3
+++ Completion/Base/_arguments 2000/04/07 12:39:30
@@ -258,8 +258,9 @@
# Otherwise we call it with the description-arguments.
eval "action=( $action )"
- _all_labels arguments expl "$descr" \
- "$action[1]" "$subopts[@]" "${(@)action[2,-1]}"
+ while _next_label arguments expl "$descr"; do
+ "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}"
+ done
fi
fi
fi
Index: Completion/Base/_values
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_values,v
retrieving revision 1.2
diff -u -r1.2 _values
--- Completion/Base/_values 2000/04/01 20:43:43 1.2
+++ Completion/Base/_values 2000/04/07 12:39:30
@@ -141,8 +141,9 @@
# Otherwise we call it with the description-arguments built above.
eval "action=( $action )"
- _all_labels arguments expl "$descr" \
- "$action[1]" "$subopts[@]" "${(@)action[2,-1]}"
+ while _next_label arguments expl "$descr"; do
+ "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}"
+ done
fi
fi
Index: Completion/Core/_alternative
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_alternative,v
retrieving revision 1.2
diff -u -r1.2 _alternative
--- Completion/Core/_alternative 2000/04/01 20:43:43 1.2
+++ Completion/Core/_alternative 2000/04/07 12:39:30
@@ -66,8 +66,9 @@
# Otherwise we call it with the description-arguments built above.
eval "action=( $action )"
- _all_labels "${def%%:*}" expl "$descr" \
- "$action[1]" "$subopts[@]" "${(@)action[2,-1]}"
+ while _next_label "${def%%:*}" expl "$descr"; do
+ "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}"
+ done
fi
fi
done
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-04-07 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-07 12:41 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-04-07 12:07 Andrej Borsenkow
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=200004071241.OAA24849@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@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).