Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
"invalid arguments" in cpio completion
- X-seq: zsh-workers 39827
- From: Danek Duvall <duvall@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: "invalid arguments" in cpio completion
- Date: Thu, 3 Nov 2016 13:32:56 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This is on 5.2, but I don't see any changes to either _cpio or _arguments
between then and HEAD that appear to be relevant.
Here's the problem:
$ cpio -p <TAB>
_arguments:comparguments:313: invalid argument:
The comparguments call is
+_arguments:313> comparguments -i '' -s : '' '-d[create directories as needed]' '-l[link files instead of copying]' '-L[follow symbolic links]' '-m[preserve file modification times]' '-R[set user and group for files]:user (and group) for files:->user' '*:destination directory:_files -/' '-a[reset access time of input files]'
I'm guessing that it's the empty argument after "-s :", but I'm not sure.
That seems to be coming from this oddity:
$ local args
$ args+=(a b c)
$ print -l -- "$args[@]"
a
b
c
But explicitly declaring args as an array makes it work:
$ local -a args
$ args+=(a b c)
$ print -l -- "$args[@]"
a
b
c
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.
Thanks,
Danek
Messages sorted by:
Reverse Date,
Date,
Thread,
Author