Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 26215 - /etc/init.d/ scripts need completion in package "app-shells/bash-completion" :-)
Summary: /etc/init.d/ scripts need completion in package "app-shells/bash-completion" :-)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Christian Birchinger (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 21226
Blocks:
  Show dependency tree
 
Reported: 2003-08-08 09:45 UTC by Dark Ryder
Modified: 2003-09-09 16:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dark Ryder 2003-08-08 09:45:34 UTC
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/*
Comment 1 Dark Ryder 2003-08-08 09:49:13 UTC
(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>")
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2003-08-08 10:49:23 UTC
Seems like a dup of bug 21226
Comment 3 Dark Ryder 2003-08-08 11:56:11 UTC
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.
Comment 4 Christian Birchinger (RETIRED) gentoo-dev 2003-09-09 15:27:04 UTC
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.

Comment 5 Christian Birchinger (RETIRED) gentoo-dev 2003-09-09 15:50:01 UTC
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.
Comment 6 Christian Birchinger (RETIRED) gentoo-dev 2003-09-09 16:15:47 UTC
bash-completion-20030821.ebuild with some basic init.d support has been added to
portage.