* zsh _multi_parts patch and question
@ 2016-05-10 7:23 Marko Myllynen
2016-05-10 10:24 ` Jun T.
0 siblings, 1 reply; 3+ messages in thread
From: Marko Myllynen @ 2016-05-10 7:23 UTC (permalink / raw)
To: zsh-workers
Hi,
First here's a trivial patch to mention the -i option for _multi_parts:
---
Doc/Zsh/compsys.yo | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index d478e81..203c436 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -4416,7 +4416,7 @@ the time this function is called, tt(compstate[insert]) is cleared, so
additional matches generated later are not inserted on the command line.
)
findex(_multi_parts)
-item(tt(_multi_parts) var(sep) var(array))(
+item(tt(_multi_parts) [ tt(-i) ] var(sep) var(array))(
The argument var(sep) is a separator character.
The var(array) may be either the
name of an array parameter or a literal array in the form
But I have a question as well, am I perhaps missing something obvious
or is this is a bug in multiparts - consider this example:
#compdef foo
local curcontext="$curcontext" state line expl
_arguments -C -s -w \
'(- *)'{-h,--help}'[display help information]' \
'(- *)'{-V,--version}'[print program version]' \
"(-t --test)"{-t+,--test}'[test]:test:->multipart' \
'*:foo:_files' \
&& return 0
if [[ $state == multipart ]]; then
# Ok
# typeset -a res
# res=( a.b.a a.b.b b.a.a b.a.b c.a.a c.a.b )
# _wanted test expl test _multi_parts -i . res && return 0
# Fail
_wanted test expl test _multi_parts -i . \
( a.b.a a.b.b b.a.a b.a.b c.a.a c.a.b ) && return 0
fi
So the former approach works but according to the man page the latter
should work as well, no?
Thanks,
--
Marko Myllynen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: zsh _multi_parts patch and question
2016-05-10 7:23 zsh _multi_parts patch and question Marko Myllynen
@ 2016-05-10 10:24 ` Jun T.
2016-05-10 11:47 ` Marko Myllynen
0 siblings, 1 reply; 3+ messages in thread
From: Jun T. @ 2016-05-10 10:24 UTC (permalink / raw)
To: zsh-workers
On 2016/05/10, at 16:23, Marko Myllynen <myllynen@redhat.com> wrote:
>
> First here's a trivial patch to mention the -i option for _multi_parts:
Thanks, I've pushed the patch.
> # Fail
> _wanted test expl test _multi_parts -i . \
> ( a.b.a a.b.b b.a.a b.a.b c.a.a c.a.b ) && return 0
You need to quote the literal array, for example,
_wanted test expl test _multi_parts -i . \
'( a.b.a a.b.b b.a.a b.a.b c.a.a c.a.b )' && return 0
Jun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: zsh _multi_parts patch and question
2016-05-10 10:24 ` Jun T.
@ 2016-05-10 11:47 ` Marko Myllynen
0 siblings, 0 replies; 3+ messages in thread
From: Marko Myllynen @ 2016-05-10 11:47 UTC (permalink / raw)
To: zsh-workers
Hi,
On 2016-05-10 13:24, Jun T. wrote:
> On 2016/05/10, at 16:23, Marko Myllynen <myllynen@redhat.com> wrote:
>
>> # Fail
>> _wanted test expl test _multi_parts -i . \
>> ( a.b.a a.b.b b.a.a b.a.b c.a.a c.a.b ) && return 0
>
> You need to quote the literal array, for example,
>
> _wanted test expl test _multi_parts -i . \
> '( a.b.a a.b.b b.a.a b.a.b c.a.a c.a.b )' && return 0
Ah, ok, now it's obvious, I think I was confused by to quoting in the
man page, this is what I see when in zshcompsys(1):
a literal array in the form `(foo bar)', a parenthesised list of words
Thanks,
--
Marko Myllynen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-10 11:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10 7:23 zsh _multi_parts patch and question Marko Myllynen
2016-05-10 10:24 ` Jun T.
2016-05-10 11:47 ` Marko Myllynen
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).