Added git pretty alias.
[profile.git] / .profile.d / completion.bashrc
index e18ec39..8ff324d 100644 (file)
@@ -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=~/.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+"$@"}
@@ -130,3 +132,5 @@ complete -F _known_hosts knh
 complete -F _modprobe modprobe
 complete -F _rmmod rmmod
 complete -F _global global
+
+fi