tab-completion for portage tools
Step 1: Set bash-completion USE flag
grep -q 'USE\([:space:]\)*=.*bash-completion' /etc/make.conf || sed --in-place -e 's/USE\([:space:]\)*="/USE="bash-completion /g' /etc/make.conf
Step 2a: updating world
If you had to add the use flag, you will now want to update world to ensure all necessary packages are using it.
emerge -uN world
Step 2b: emerging needed ebuilds
emerge -av bash-completion gentoo-bashcomp
This will emerge the packages you need bash-completion (programmable completion for BASH) and gentoo-bashcomp (gentoo-based BASH CLI completions)
Step 3: editing the bashrc
since most portage tools are primarily for root we’ll add the bash completion line (bash-completion recommends adding this to ~/.bashrc normally) on a more global scale by placing it in /etc/bash/bashrc
echo "[[ -f /etc/profile.d/bash-completion ]] && source /etc/profile.d/bash-completion" >>/etc/bash/bashrc
source /etc/bash/bashrc
All Done!
basic usage would look like so:
emerge ne
emerge net-
etc…
No Comments »
RSS feed for comments on this post. TrackBack URL