I can't understand how $COMP_WORDBREAKS works and why quotes on command line 
give such a weird result. Test function is following:
--------------------------
_zz()
{
    echo -e "\n* $COMP_CWORD:"
    for (( i=0; i <= COMP_CWORD; i++ )); do
        echo "[${COMP_WORDS[i]}]"
    done
} && complete -F _zz zz
--------------------------

That's what the function prints if there are quotes on command line:
--------------------------
$ zz --w="v u" --x=abc --y=0,a2 xx<TAB>
* 4:
[zz]
[--w]
[="]
[v]
[u" --x=abc --y=0,a2 xx]
--------------------------

Without quotes result looks fine:
--------------------------
$ zz --w=v\ u --x=abc --y=0,a2 xx<TAB>
* 10:
[zz]
[--w]
[=]
[v\ u]
[--x]
[=]
[abc]
[--y]
[=]
[0,a2]
[xx]
--------------------------

Am I missing something or is it a bug in bash?


-- Igor

_______________________________________________
Bash-completion-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-devel

Reply via email to