Hi,
if I execute the completion script below and enter "foo <tab>", bash prints
only "dir" instead of "but/dir".
If I don't use "-o filenames" then bash prints "but/dir". But then "foo e<tab>"
doesn't gives the space char escaped anymore.
Is there a way to accomplish both, full path completion and escaping?
Not sure where this behavior comes from (readline or bash).
Thanks and best regards,
John
_foo()
{
local cur=${COMP_WORDS[COMP_CWORD]}
case "$cur" in
w*)
COMPREPLY=( 'we/complete/with/slash' )
;;
e*)
COMPREPLY=( 'escape works' )
;;
*)
COMPREPLY=( 'but/dir' 'not shown' )
;;
esac
}
complete -o filenames -F _foo foo