summaryrefslogtreecommitdiff
path: root/bash_completion.sh.in
blob: a28e1a62e215ccb946aca96f5d0bbbd2ae731bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Check for interactive bash and that we haven't already been sourced.
if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then

    # Check for recent enough version of bash.
    if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
       [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
        [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
            . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
        if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
            # Source completion code.
            . @pkgdatadir@/bash_completion
        fi
    fi

fi