| 1 |
ka0ttic |
1.1 |
# Copyright 1999-2004 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
ka0ttic |
1.2 |
# $Header: /var/cvsroot/gentoo-x86/eclass/bash-completion.eclass,v 1.1 2004/10/26 22:28:22 ka0ttic Exp $
|
| 4 |
ka0ttic |
1.1 |
#
|
| 5 |
|
|
# Simple eclass that provides an interface for installing
|
| 6 |
|
|
# contributed (ie not included in bash-completion proper)
|
| 7 |
|
|
# bash-completion scripts.
|
| 8 |
|
|
#
|
| 9 |
|
|
# Author: Aaron Walker <ka0ttic@gentoo.org>
|
| 10 |
|
|
#
|
| 11 |
|
|
# Please assign any bug reports to shell-tools@gentoo.org.
|
| 12 |
|
|
|
| 13 |
|
|
ECLASS="bash-completion"
|
| 14 |
|
|
INHERITED="${INHERITED} ${ECLASS}"
|
| 15 |
|
|
|
| 16 |
|
|
IUSE="${IUSE} bash-completion"
|
| 17 |
ka0ttic |
1.2 |
RDEPEND="${RDEPEND}
|
| 18 |
|
|
bash-completion? ( app-shells/bash-completion )"
|
| 19 |
ka0ttic |
1.1 |
|
| 20 |
|
|
# dobashcompletion <file> <new file>
|
| 21 |
|
|
# First arg, <file>, is required and is the location of the bash-completion
|
| 22 |
|
|
# script to install. Second arg, <new file>, is optional and specifies an
|
| 23 |
|
|
# alternate filename to install as.
|
| 24 |
|
|
|
| 25 |
|
|
dobashcompletion() {
|
| 26 |
|
|
[ -z "$1" ] && die "usage: dobashcompletion <file> <new file>"
|
| 27 |
|
|
if useq bash-completion ; then
|
| 28 |
|
|
insinto /usr/share/bash-completion
|
| 29 |
|
|
newins "$1" "${2:-${1##*/}}"
|
| 30 |
|
|
fi
|
| 31 |
|
|
}
|