From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Danek Duvall <duvall@comfychair.org>, zsh-workers@zsh.org
Subject: Re: "invalid arguments" in cpio completion
Date: Sat, 5 Nov 2016 20:39:46 +0000 [thread overview]
Message-ID: <20161105203946.GB11681@fujitsu.shahaf.local2> (raw)
In-Reply-To: <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)'
next prev parent reply other threads:[~2016-11-05 20:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 20:32 Danek Duvall
2016-11-05 20:39 ` Daniel Shahaf [this message]
2016-11-05 21:52 ` Bart Schaefer
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=20161105203946.GB11681@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=duvall@comfychair.org \
--cc=zsh-workers@zsh.org \
/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).