Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70329 - skel .bashrc should also include code for per-user bash-completions
Summary: skel .bashrc should also include code for per-user bash-completions
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-07 00:40 UTC by Aaron Walker (RETIRED)
Modified: 2004-11-09 21:54 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 Aaron Walker (RETIRED) gentoo-dev 2004-11-07 00:40:53 UTC
Now that it is possible to have per-user bash completions installed via bash-completion-config, the skel .bashrc provided by baselayout should include code to source any files in ~/.bash_completion.d (commented out by default, of course).

Something like the following:

[ -d ~/.bash_completion.d ] && for i in ~/.bash_completion.d/*; do [ -f $i ] && . $i; done
Comment 1 SpanKY gentoo-dev 2004-11-07 22:27:07 UTC
the following is already in skel's bashrc:

# uncomment the following to activate bash-completion:
#[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion

why cant this suggested enhancement be added to that file instead ?
Comment 2 Ciaran McCreesh 2004-11-08 00:22:46 UTC
/etc isn't per-user.
Comment 3 Aaron Walker (RETIRED) gentoo-dev 2004-11-08 05:33:06 UTC
heh that was my original idea but I didn't think it would work (obviously I wasn't alone ;p).  

$ tail /etc/profile.d/bash-completion
if [ "$PS1" ] && [ -d ~/.bash_completion.d ] ; then
    for file in ~/.bash_completion.d/* ; do
        [ -f $file ] && source $file
    done
fi
$ echo lala="LALALALALALALA" > ~/.bash_completion.d/lala
$ . /etc/profile.d/bash-completion
$ echo $lala
LALALALALALALA

Sorry for the spam guys...
Comment 4 SpanKY gentoo-dev 2004-11-09 21:54:04 UTC
i didnt say /etc was per-user, but if the global bash-completion does a per-user check like Aaron suggested ...