dotfiles/bash_completion

37 lines
731 B
Bash

LOCAL_BASH_COMPLETION_DIR=$HOME/.bash_completion.d
_debug()
{
test -n "$DEBUG" && echo "$1"
}
_source_local_bash_completion()
{
# source completion directory definitions
if [ -n "$(complete | grep "__proj_activate")" ]
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