Quote: (from forums) > I type: > emerge /usr/port [tab] > > The completion works as expected: > "/usr/portage/" > > I then type: > kde-b [tab] > > The completion looks like this: > "/usr/portage/kde-base " {note trailing space, no trailing slash} > > I expect the completion to look like this: > "/usr/portage/kde-base/" Patch to /etc/bash_completion.d/gentoo to follow.
Created attachment 22920 [details, diff] 2-liner patch Content: @@ -286,7 +286,9 @@ fi if [ "${cur}" ]; then - if [ $(echo "${cur}" | grep '/') ]; then + if [[ "${cur} " == @('/'|'.'|'~'|'$')* ]]; then + COMPREPLY='' + elif [ $(echo "${cur}" | grep '/') ]; then setbig=$(compgen -G "${cur}*" | ${sedcmd})"${systemactions}" COMPREPLY=($(echo "${setbig}" | $grepcmd)) else Using the same conditional expression as in the unmerge stanza to differentiate paths (absolute and relative) from Gentoo package names.
Created attachment 23107 [details] Latest and greatest. This incorporates the patch previously attached (thanks, Ed) and contains improvements to the previous version. Please let me know if you encounter any problems.
Do you have a cleaned up (Removed commented out lines etc.) version for next release? I have to merge it then with the other commited functions which are added in the current version of gentoo.completion (20031215).
Shouldn't the '| grep ^${cur}' be replaced with '-- ${cur}' ? Removes the need for one external command which is always good in bash-completion.
I'm closing this bug because a fix has been added to the current version. I'm still willing to update the whole gentoo complition but i need a cleaned version for a release.