Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "invalid arguments" in cpio completion
- X-seq: zsh-workers 39840
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Danek Duvall <duvall@xxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: "invalid arguments" in cpio completion
- Date: Sat, 5 Nov 2016 20:39:46 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=bZumdcQ3IMYQAstrvmOGFEWy3Zk=; b=qDOimFMeM4eD/uJinabBg h1B4LTVEfEu0hgiTZ15h/kd9UNLYRVQFG+Y2J/9nkd3ThbKNc+i0HhXbkmDievrS GB4D54FCSaBOLAtsM9VefFQoG/qTWA2B1c3hC9+cWmQ8YOqFw7TwtpUX3hgN/zSP FxIEhwSeo2y5gmIWjPYsRY=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=bZumdcQ3IMYQAstrvmOGFEWy3Zk=; b=AfQTq/wm35MsM0vMBTxd FtduBANv7XVn86igyjgGt0U3ASx46/kHSmf8E/mhjYGB7XjLZn7B/ldaHrZOPq1a frfYIumSt5hACxGIwQaJg4T/bFq3fAEd3J2zMjQSGTdC8j2lurBMMzwKmKs547gN J1mQhIqNK+koLAeyXX82M/4=
- In-reply-to: <20161103203256.GA13691@lorien.comfychair.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20161103203256.GA13691@lorien.comfychair.org>
Danek Duvall wrote on Thu, Nov 03, 2016 at 13:32:56 -0700:
> $ cpio -p <TAB>
> _arguments:comparguments:313: invalid argument:
>
In HEAD I get filename completion at this point, regardless of whether
I choose the 'gnu' or 'unix' variant.
> That seems to be coming from this oddity:
>
> $ local args
> $ args+=(a b c)
> $ print -l -- "$args[@]"
>
> a
> b
> c
>
This behaviour is the same in HEAD.
> But explicitly declaring args as an array makes it work:
⋮
> and making that change in _cpio makes the completion work. I'm just not
> sure if the += construct on a scalar is supposed to make any sense here.
Will fix.
Cheers,
Daniel
diff --git a/Completion/Unix/Command/_cpio b/Completion/Unix/Command/_cpio
index 4027cc0..699b1d8 100644
--- a/Completion/Unix/Command/_cpio
+++ b/Completion/Unix/Command/_cpio
@@ -1,6 +1,7 @@
#compdef cpio
-local args ig curcontext="$curcontext" state line
+local -a args
+local ig curcontext="$curcontext" state line
local expl ret=1
local fmts='(bar bin odc newc crc tar ustar hpbin hpodc)'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author