-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_bash_completion
24 lines (20 loc) · 951 Bytes
/
dot_bash_completion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*-mode:bash-*- vim:ft=bash
# shellcheck shell=bash disable=SC1091
# ~/.bash_completion
# =============================================================================
# Programmable completion functions for bash.
#
# See https://github.com/scop/bash-completion
# Check for interactive bash and that we haven't already been sourced.
if [[ "${BASH_VERSION-}" != "" ]] && [[ "${PS1-}" != "" ]] && [[ "${BASH_COMPLETION_VERSINFO-}" = "" ]]; then
# Check for recent enough version of bash.
if [[ "${BASH_VERSINFO[0]}" -gt 4 ]] ||
[[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 2 ]]; then
# Source completion code.
if [[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ]]; then
source "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
elif shopt -q progcomp && [[ -r /usr/local/share/bash-completion/bash_completion ]]; then
source /usr/local/share/bash-completion/bash_completion
fi
fi
fi