Could the gentoo bashcomp definitions include the support for rc-service? This is a new interface for the service control and not included yet. I am not able to supply a patch, but would do testing if I can help that way. Thanks justin Reproducible: Always
Hi, I just started looking at gentoo-bashcomp and I will look into your request here. For now I am working on a new stable candidate release.
Actually, you will need to mimic the _rcupdate() function in /usr/share/bash-completion/gentoo from gentoo-bashcomp to achieve this. To be frank, I don't have any motivation to do this because I think that rc-update is sufficient.
rc-update == managing the rc services rc-services == running rc services
Created attachment 190264 [details, diff] proposed patch for rc-service This should update the gentoo-bashcomp to include rc-service. If you want to apply it to the installed thing do (as root) "patch -d /etc/bash_completion.d/ -p2 < rc-service.patch" to undo "patch -R -d /etc/bash_completion.d/ -p2 < rc-service.patch" The only problem it has is that it doesn't look inside the init scripts which options are available, it assumes that every option is included (ineed, iuse, needsme, pause, restart, start, status, stop, usesme, zap) If I forgot one, just mention, I'll fix it. If you or anyone who reads this is skilled in shell scripts I'd like to know how to achieve this functionality. :)
(In reply to comment #4) > Created an attachment (id=190264) [edit] > proposed patch for rc-service > > This should update the gentoo-bashcomp to include rc-service. > If you want to apply it to the installed thing do (as root) > > "patch -d /etc/bash_completion.d/ -p2 < rc-service.patch" > to undo > "patch -R -d /etc/bash_completion.d/ -p2 < rc-service.patch" > > The only problem it has is that it doesn't look inside the init scripts which > options are available, it assumes that every option is included (ineed, iuse, > needsme, pause, restart, start, status, stop, usesme, zap) If I forgot one, > just mention, I'll fix it. If you or anyone who reads this is skilled in shell > scripts I'd like to know how to achieve this functionality. :) > I think you can just use grep to grab the options out of there. right? Something like line 22 of http://sources.gentoo.org/viewcvs.py/gentoo-bashcomp/trunk/layman?annotate=84
Created attachment 190401 [details, diff] Fixed patch for rc-service Yep, thanks. I was a bit slow on the uptake. ;-) I attached the fixed version with the grep thing. It should now only display the options included in the scripts to stop confusion. Also custom options could be included into the init scripts and read by the completion script.
Ping! This patch committed yet?
Oops, forgot about this one. Thanks Finn! Release is happening tonight.
Many thanks for this patch. I was just going to look into why rc-service wasn't listing init.d scripts using bash-completion! Only took like 5 years and only after my bash script /usr/sbin/service started to fowl over. Many thanks for this. I can now easily use a gentoo related tool for checking services! (The eselect tool is ridiculously overly complicated for managing init.d scripts.)