zsh-workers
 help / color / mirror / code / Atom feed
* "invalid arguments" in cpio completion
@ 2016-11-03 20:32 Danek Duvall
  2016-11-05 20:39 ` Daniel Shahaf
  0 siblings, 1 reply; 3+ messages in thread
From: Danek Duvall @ 2016-11-03 20:32 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-05 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-03 20:32 "invalid arguments" in cpio completion Danek Duvall
2016-11-05 20:39 ` Daniel Shahaf
2016-11-05 21:52   ` Bart Schaefer

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).