Bash completion get cword cannot handle quotes
From FVue
Problem
Bash-completion's (version 1.0) _get_cword cannot handle quotes. Consider this:
$ complete -F _get_cword a
With `|' (pipe) denoting the cursor position:
a 'b c| doesn't return b c, instead it returns c a "b c| doesn't return b c, instead it returns c
See also
- Properly handling spaces and quotes in bash completion - Stack Overflow
- Same problem raised by Karl Ove Hufthammer, with solutions
Advertisement