The init scripts in /etc/init.d/ are not included in the "gentoo" bash- completion file. Reproducible: Always Steps to Reproduce: 1. # /e<tab>/in<tab>/dh<tab> r<tab> (for example) Actual Results: # /etc/init.d/dhcp r Expected Results: # /etc/init.d/dhcp restart To add appropriate completion to the /etc/init.d/ scripts, just add the following line to app-shells/files/gentoo.completion (a.k.a. /etc/bash_completion/gentoo): complete -W "start stop restart pause zap ineed needsme iuse usesme broken" /etc/init.d/*
(Whoops -- I forgot to remove the space and slashes in the "Steps to reproduce". Most people would just type "/e<tab>in<tab>dh<tab>r<tab>")
Seems like a dup of bug 21226
Hmm. Very similar (I wonder why that didn't show up in my search for "completion"?), but I approached it from the angle of adding support for Gentoo's rc-scripts to the already-gentoo-specific addition to bash-completion found in the Portage package. This seems appropriate given the triviality of the necessary change and the fact that rc-update is already supported by it.
complete -W "start stop restart pause zap ineed needsme iuse usesme broken" /etc/init.d/* is ugly. When you do complete | grep init.d you'll see that it creates a new completion entry for each file in init.d at the time bash-completion was started. If you add scripts to init.d later it wont dynamicaly update it.
I use this now: complete -W "start stop restart pause zap ineed needsme iuse usesme broken" \ $(for i in /etc/init.d/*; do echo ${i##*/}; done) Still seems to add multiple lines to the "complete" list but i guess thats normal. If someone wants to add an "opts=" parser patches will get accepted but i'm not the author of gentoo.completion myself.
bash-completion-20030821.ebuild with some basic init.d support has been added to portage.