[Bug 1394920] Re: complete -o filename can't be used with filenames relative to another directory to handle space vs. trailing /

2014-12-10 Thread hakon
Hi Peter, you were completely right! Now I have got some help at stackoverflow, and it seems that helped solve this issue. There are four things that seems must be in place to solve it: 1. compopt -o nospace 2. compopt -o filenames 3. Running compgen -f with an absolute path 4. Then

[Bug 1394920] Re: complete -o filename can't be used with filenames relative to another directory to handle space vs. trailing /

2014-12-02 Thread hakon
Thanks Peter! See follow-up question at stackoverflow: http://stackoverflow.com/questions/27244300/how-to-complete-filenames- relative-to-another-directory -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu.

[Bug 1394920] Re: complete -o filename can't be used with filenames relative to another directory to handle space vs. trailing /

2014-12-01 Thread hakon
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

[Bug 1394920] Re: complete -o filename can't be used with filenames relative to another directory to handle space vs. trailing /

2014-12-01 Thread Peter Cordes
Was working on completions for something else, and thought of this when I saw completions/make checking if COMPREPLY has only a single entry. If it does, that means completion will replace the user's word, rather than show possible completions. In that case, run compopt -o nospace. And maybe