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

RE: _values does not quote inserted matches



> > I don't know why the Q is included on line 55?  It seems to all work
OK if
> > I take it out.
> 
> Same for me. And I couldn't find when we added this, so it's probably
> very old, from a time when _values was less sophisticated about
> separators with special characters or something.
> 
> So, let's try.
> 

Now, this does quote inserted string which is good. Unfortunately, it is
still confused by inserted quotes ... 

_urpmi_media() {
    local source media brace
    local -a all_sources suf
    local context state line
    typeset -A val_args
    while read source media brace; do
        [[ "$brace" != "{" ]] && continue
        all_sources=($all_sources[@] $source)
    done < /etc/urpmi/urpmi.cfg

    _values -s , 'urpmi media' $all_sources
}

bor@cooker% urpmi --media Contrib\ CD,
Completing urpmi media
Contrib CD        Installation CD

So far so good. But if I now hit ENTER and try complete again ...

bor@cooker% urpmi --media Contrib\ CD,
No matches for: `urpmi media'

Looks like _values get confused by quoting on command line?

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author