On Wed, 16 Sep 2009 23:34:51 +0200, Freddy Vulto wrote:

> I'm looking further into _get_cword, but COMP_CWORDS appears to behave
> differently depending on the bash-version.

Can this be because of: (http://tiswww.case.edu/php/chet/bash/NEWS)

i.  The programmable completion code now uses the same set of characters as
    readline when breaking the command line into a list of words.

> Can other people confirm this?  Try this script:
> 
> ---8<------------------------------------------
> _cword() {
>     echo
>     echo COMP_CWORD: $COMP_CWORD
>     echo COMP_CWORDS:
>     for ((i=0; i < ${#comp_wor...@]}; i++)); do
>         echo $i: "${COMP_WORDS[$i]}"
>     done
> }
> complete -F _cword a
> ---8<------------------------------------------
> 
> On bash-4 I get:
> 
>     $ a 'b c<TAB>
>     COMP_CWORD: 3
>     COMP_CWORDS:
>     0: a
>     1: '
>     2: b
>     3: c

Confirmed.

> Whereas on bash-3, bash-2 I get:
> 
>     $ a 'b c<TAB>
>     COMP_CWORD: 1
>     COMP_CWORDS:
>     0: a
>     1: 'b c
> 
> Is this because of bash-4 or because of some other setting?

I can't confirm this (have a bash-3 system, but with an older bash-completion
too, and unable to copy it over there)

David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174

Attachment: signature.asc
Description: PGP signature

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

Reply via email to