fi
}
-case `uname -s` in
- Linux)
- function choosesim()
- {
- echo "Build for the simulator or the device?"
- echo " 1. Device"
- echo " 2. Simulator"
- echo
-
- export TARGET_SIMULATOR=
- local ANSWER
- while [ -z $TARGET_SIMULATOR ]
- do
- echo -n "Which would you like? [1] "
- if [ -z "$1" ] ; then
- read ANSWER
- else
- echo $1
- ANSWER=$1
- fi
- case $ANSWER in
- "")
- export TARGET_SIMULATOR=false
- ;;
- 1)
- export TARGET_SIMULATOR=false
- ;;
- Device)
- export TARGET_SIMULATOR=false
- ;;
- 2)
- export TARGET_SIMULATOR=true
- ;;
- Simulator)
- export TARGET_SIMULATOR=true
- ;;
- *)
- echo
- echo "I didn't understand your response. Please try again."
- echo
- ;;
- esac
- if [ -n "$1" ] ; then
- break
- fi
- done
-
- set_stuff_for_environment
- }
- ;;
- *)
- function choosesim()
- {
- echo "Only device builds are supported for" `uname -s`
- echo " Forcing TARGET_SIMULATOR=false"
- echo
- if [ -z "$1" ]
- then
- echo -n "Press enter: "
- read
- fi
-
- export TARGET_SIMULATOR=false
- set_stuff_for_environment
- }
- ;;
-esac
-
+ 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
+ }
+
function choosetype()
{
echo "Build type choices are:"