[Bash-completion-devel] Bug with key=value options?

David Paleino dapal at debian.org
Sun Jan 8 16:15:55 UTC 2012


On Sun, 08 Jan 2012 16:38:02 +0200, Ville Skyttä wrote:

> On 2012-01-08 14:43, David Paleino wrote:
> > Hello people,
> > please consider the following snippet:
> > 
> > --->8---
> > _foo() {
> >     local cur prev words cword
> >     _init_completion -n = || return
> >     
> >     case $cur in
> >         bar=*)
> >             cur=${cur#*=}
> >             _filedir
> >             return 0
> >             ;;
> >     esac
> > 
> >     _expand || return 0
> > 
> >     COMPREPLY=( $(compgen -W 'bar' -S'=' -- "$cur") )
> >     return 0
> > }
> > complete -F _foo -o nospace foo
> > ---8<---
> > 
> > What I get is:
> > 
> > $ foo bar=<TAB>
> > abc
> > bla
> > foo
> > $ foo bar=b<TAB>
> > $ foo bla
> 
> What I get is (assuming there are abc, bla, and foo files in $PWD):
> 
> $ foo bar=<TAB>
> abc  bla  foo
> $ foo bar=b<TAB>
> $ foo bar=bla
> 
> ...so I suppose it's working as expected for me.  This is on Fedora 16,
> bash-completion current git master, bash 4.2.20(1)-release.

Same bashcomp and bash version here. But on Debian :o)

I'm attaching the "set -x" output when I do foo bar=b<TAB> (truly speaking,
it's bar=ac<TAB>, trying to complete some aclocal.m4 I have in the current
directory).

Would you mind comparing it to yours?

Thanks,
David

-- 
 . ''`.   Debian developer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://deb.li/dapal
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set-x.log
Type: text/x-log
Size: 4969 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20120108/d18d594f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20120108/d18d594f/attachment.pgp>


More information about the Bash-completion-devel mailing list