X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2Fcompletion.bashrc;h=3c3ec3325cfcb82a15bbf49dd0a18cd8092d8032;hp=ae18697cbf6fd7d40931ecb121d60fd122cc028c;hb=0614eba6741fe0b5f1ef54ad7478fe003ca0e613;hpb=4fedd438b177cc8adf227da193642b139a1ee5f4 diff --git a/.profile.d/completion.bashrc b/.profile.d/completion.bashrc index ae18697..3c3ec33 100644 --- a/.profile.d/completion.bashrc +++ b/.profile.d/completion.bashrc @@ -1,9 +1,11 @@ -# $Id$ +# 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=~/.ssh/hosts -export COMPLETION_DIR_PING="$COMPLETION_DIR_SSH $COMPLETION_DIR_TELNET $COMPLETION_DIR_RDP" +COMPLETION_DIR_SSH=~/.ssh/hosts +COMPLETION_DIR_TELNET=~/.telnet/hosts +COMPLETION_DIR_RDP=~/.rdp/hosts +COMPLETION_DIR_PING="$COMPLETION_DIR_SSH $COMPLETION_DIR_TELNET $COMPLETION_DIR_RDP" function _generic_completion() { COMPLETION_DIR=${1+"$@"} @@ -131,7 +133,4 @@ complete -F _modprobe modprobe complete -F _rmmod rmmod complete -F _global global -unset COMPLETION_DIR_PING -unset COMPLETION_DIR_RDP -unset COMPLETION_DIR_SSH -unset COMPLETION_DIR_TELNET +fi