From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1749 invoked from network); 7 Apr 2000 12:42:18 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Apr 2000 12:42:18 -0000 Received: (qmail 7826 invoked by alias); 7 Apr 2000 12:41:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10579 Received: (qmail 7813 invoked from network); 7 Apr 2000 12:41:45 -0000 Date: Fri, 7 Apr 2000 14:41:32 +0200 (MET DST) Message-Id: <200004071241.OAA24849@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Fri, 7 Apr 2000 16:07:26 +0400 Subject: Re: Q about _arguments 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 > > 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