On Thu, Sep 20, 2012 at 01:08:29AM +0200, Felipe Contreras wrote: > On Wed, Sep 19, 2012 at 9:55 PM, Jeff King <peff@xxxxxxxx> wrote: > > > I have no idea if that internal to bash's filename completion, or if > > there is some easy facility offered to programmable completions to do > > the same thing. I don't think this is a high priority, but it would be > > nice to handle it. And moreover, I am really wondering if we are missing > > some solution that bash is providing to help us with the quoting issues. > > Surely we are not the first completion script to come up against this. > > I found a much easier solution: > > - COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}")) > + COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$(quote "$1")" > -- "${3-$cur}")) Oh, nice. :) > But what about the people that don't have bash-completion? > > BTW: > > quote() > { > local quoted=${1//\'/\'\\\'\'} > printf "'%s'" "$quoted" > } That is short and obvious enough that we could probably just cut-and-paste it into our script as _git_quote (and it is basically a cleaner version of the thing that I posted). -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html