diff --git a/envsetup.sh b/envsetup.sh index a65d39b98..c256e5c2a 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -191,6 +191,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() @@ -1138,3 +1161,5 @@ do . $f done unset f + +addcompletions