forked from openkylin/platform_build
Add bash completion to envsetup
Change-Id: I0b4d74e72deede42d7e5f229593d79417f16bb55
This commit is contained in:
parent
b399f5e81e
commit
52aa81cab9
25
envsetup.sh
25
envsetup.sh
|
@ -181,6 +181,29 @@ function settitle()
|
||||||
fi
|
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
|
case `uname -s` in
|
||||||
Linux)
|
Linux)
|
||||||
function choosesim()
|
function choosesim()
|
||||||
|
@ -1103,3 +1126,5 @@ do
|
||||||
. $f
|
. $f
|
||||||
done
|
done
|
||||||
unset f
|
unset f
|
||||||
|
|
||||||
|
addcompletions
|
||||||
|
|
Loading…
Reference in New Issue