* Re: Q about _arguments
@ 2000-04-07 12:41 Sven Wischnowsky
0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-04-07 12:41 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Q about _arguments
@ 2000-04-07 12:07 Andrej Borsenkow
0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 2000-04-07 12:07 UTC (permalink / raw)
To: ZSH workers mailing list
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
passmass* patch* patgen* perl* perl5.00404*
perl5.00502* perlbug* perlcc* perldoc* pfbtops*
pico* pilot* pine* pkgs_to_mmin* pktogf*
pktype* pl2pm* plot* plotfont* pltotf*
pod2html* pod2latex* pod2man* pod2text* pooltype*
procmail* prune_logs* psbb* psbook* psmerge*
psnup* psresize* psselect* pstops* pstruct*
note, that I'd expect "Completing mail delivery program" here.
-andrej
Have a nice DOS!
B >>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-04-07 12:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-07 12:41 Q about _arguments Sven Wischnowsky
-- strict thread matches above, loose matches on Subject: below --
2000-04-07 12:07 Andrej Borsenkow
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).