Firstly, $ ebuild /usr/portage/media-vid<tab> gives /usr/portage/media-video(space): should be /usr/portage/media-video/ Secondly, $ ebuild --debug <tab> gives a list of actions ..., should be a list of ebuilds Thirdly, $ ebuild foo.ebuild clean <tab> gives a list of ebuilds etc, should be further actions.
Here's what I've changed it to in my /etc/bash_completion.d/gentoo: # # ebuild completion command # have ebuild && { _ebuild() { local cur COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) $(compgen -d -- ${cur}) $(compgen -W '--debug' -- ${cur})) elif [ $COMP_CWORD -eq 2 -a "${COMP_WORDS[1]}" = "--debug" ]; then COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) $(compgen -d -- ${cur})) elif [ $COMP_CWORD -ge 2 ]; then COMPREPLY=($(compgen -W 'clean compile config \ depend digest \ fetch \ help \ install \ merge \ package postinst postrm preinst prerm \ qmerge \ rpm \ setup \ unmerge unpack' ${cur})) fi return 0 } complete $filenames -F _ebuild ebuild } I'll also attach it as a patch.
Created attachment 48419 [details, diff] gentoo.patch
Thanks Ed. 20050112-r1 has just been committed.