Skip to content

Instantly share code, notes, and snippets.

@zerda
Created May 28, 2017 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerda/cf4f91b290b4b5fd2abdb7a7f6e1e9f0 to your computer and use it in GitHub Desktop.
Save zerda/cf4f91b290b4b5fd2abdb7a7f6e1e9f0 to your computer and use it in GitHub Desktop.
Bash Completion Init Script
# Check for interactive bash and that we haven't already been sourced.
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_COMPAT_DIR-}" ]; 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 /usr/share/bash-completion/bash_completion ]; then
# Source completion code.
. /usr/share/bash-completion/bash_completion
fi
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment