On Thu, Sep 24, 2009 at 10:15 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
Ah, well obviously it's more complicated than I though.
The point is, that the COMP_WORDBREAKS setting, is splitting "if=" into "if" and "=", which doesn't match the case statement.
If we want to fix this just for dd, we need to match the "=" and then get the previous word in COMP_WORDS prev="${COMP_WORDS[$(($COMP_CWORD -1))]}"
Aaaaand... that doesn't work. I dunno, this is confusing, but the point is, it's splitting on the "if=" and thus can never complete as is
I tried many things earlier today, looking at other completion files, trying to use prev, splitting on =, etc. But I did not figure out the COMP_WORDBREAKS thing (the word caught a bit my attention but I did not look further). So maybe the changes I did in combination to that setting would have worked better, I am not sure. Though at the end of my experiment, I actually got a behavior very similar to what Thomas just reported. I think we need a bash completion expert :) I tried to contact the two dev about this problem but I don't know if they are active and responsive.