X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fcompletion.bashrc;h=8ff324d9192081e0d3800e4c85524b970a316b46;hb=500ba2b170e6f1bfad014c9bca55e19225a9bbe8;hp=775c20891255d9521945a27dc129a7bd3aaf8472;hpb=819bb88d5a014a23150b8fd609d194e883958674;p=profile.git diff --git a/.profile.d/completion.bashrc b/.profile.d/completion.bashrc index 775c208..8ff324d 100644 --- a/.profile.d/completion.bashrc +++ b/.profile.d/completion.bashrc @@ -1,8 +1,11 @@ +# Old bash doesn't have completion support. +if ! builtin complete 2>&1 | grep 'not a shell builtin' >/dev/null; then + # Helper! -export COMPLETION_DIR_SSH=~/.ssh/hosts -export COMPLETION_DIR_TELNET=~/.telnet/hosts -export COMPLETION_DIR_RDP=~/.rdp/hosts -export COMPLETION_DIR_PING="$COMPLETION_DIR_SSH $COMPLETION_DIR_TELNET $COMPLETION_DIR_RDP" +COMPLETION_DIR_SSH=${PROFILE_HOME:-~}/.ssh/hosts +COMPLETION_DIR_TELNET=${PROFILE_HOME:-~}/.telnet/hosts +COMPLETION_DIR_RDP=${PROFILE_HOME:-~}/.rdp/hosts +COMPLETION_DIR_PING="$COMPLETION_DIR_SSH $COMPLETION_DIR_TELNET $COMPLETION_DIR_RDP" function _generic_completion() { COMPLETION_DIR=${1+"$@"} @@ -129,3 +132,5 @@ complete -F _known_hosts knh complete -F _modprobe modprobe complete -F _rmmod rmmod complete -F _global global + +fi