From 52aa81cab97d2480d9d32c2d2c58956c088d63e2 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 15 Jul 2011 11:07:06 -0700 Subject: [PATCH] Add bash completion to envsetup Change-Id: I0b4d74e72deede42d7e5f229593d79417f16bb55 --- envsetup.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/envsetup.sh b/envsetup.sh index 8f9479af5..e79fa286f 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -181,6 +181,29 @@ function settitle() fi } +function addcompletions() +{ + local T dir f + + # Keep us from trying to run in something that isn't bash. + if [ -z "${BASH_VERSION}" ]; then + return + fi + + # Keep us from trying to run in bash that's too old. + if [ ${BASH_VERSINFO[0]} -lt 3 ]; then + return + fi + + dir="sdk/bash_completion" + if [ -d ${dir} ]; then + for f in ${dir}/[a-z]*; do + echo "including $f" + . $f + done + fi +} + case `uname -s` in Linux) function choosesim() @@ -1103,3 +1126,5 @@ do . $f done unset f + +addcompletions