Thanks for the thorough answer! If I add "shopt -s extglob" your code is
working.

The question is how to add slashes after directory names and not file names. If 
I remove "-o filenames" and add 
"compopt -o nospace" I still can use "compgen -f "$cur" " but it does not add 
slashes. And the completions are not broken at "/" (if I insert it manually) 
such that I get a completion list with "a/b/c" instead of just "c"  when I try 
to complete "a/b"..

Do I have to add a slash to $COMP_WORDBREAKS variable?

There is a post a stackoverflow :
http://stackoverflow.com/questions/10528695/how-to-reset-comp-wordbreaks-without-effecting-other-completion-script

It refers to a function "_get_comp_words_by_ref" .. where is this function 
documented? I searched the bash manual, 
http://www.gnu.org/software/bash/manual/bashref.html
but it is not mentioned there..

Thanks!

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1394920

Title:
  complete -o filename can't be used with filenames relative to another
  directory to handle  space vs. trailing /

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1394920/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to