Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

"invalid arguments" in cpio completion



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