2012-02-26 19:38:01 +00:00
|
|
|
LOCAL_BASH_COMPLETION_DIR=$HOME/.bash_completion.d
|
|
|
|
|
|
|
|
_debug()
|
|
|
|
{
|
|
|
|
test -n "$DEBUG" && echo "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_source_local_bash_completion()
|
|
|
|
{
|
|
|
|
# source completion directory definitions
|
2012-03-16 13:26:25 +00:00
|
|
|
if [ -n "$(complete | grep "__proj_activate")" ]
|
2012-02-26 19:38:01 +00:00
|
|
|
then
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x $LOCAL_BASH_COMPLETION_DIR ]
|
|
|
|
then
|
|
|
|
for i in $LOCAL_BASH_COMPLETION_DIR/*
|
|
|
|
do
|
|
|
|
local invalid="`echo $i | grep -E '.*(~|\.bak|\.swp|\.dpkg.*|\.rpm.*)'`"
|
|
|
|
if [[ ! -n "$invalid" ]] && [[ -e "$i" ]]
|
|
|
|
then
|
|
|
|
_debug "sourcing $i"
|
|
|
|
source $i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
unset i
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_source_local_bash_completion
|
|
|
|
unset _source_local_bash_completion
|
|
|
|
|
|
|
|
# vim:filetype=sh
|