Skip to content

Commit

Permalink
Re-organizing the argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ELLIOTTCABLE committed Nov 6, 2009
1 parent 480d9e4 commit 1d4ae00
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions bundle.sh
Expand Up @@ -110,8 +110,6 @@ _bundle() {
AMI=$(ec2-register --show-empty-fields "$BUCKET/$NAME.manifest.xml" \
| awk '/IMAGE/ { print $2 }')



if [[ -n $STARTED_HOST ]]; then
echo "-- Terminating the bundling host we launched"
STARTED_HOST=''
Expand Down Expand Up @@ -358,6 +356,13 @@ host_get() {
# = Argument parsing =
# ====================

case $1 in
"bundle") _bundle "$@" ;;
"test") _test "$@" ;;
"host") _host "$@" ;;
*) _usage "$@" ;;
esac

case $3 in
"32"|"x86"|"i386"|"i686")
HOST_ARCH="i686"
Expand Down Expand Up @@ -390,10 +395,3 @@ case $3 in
;;
*) usage "$@" ;;
esac

case $1 in
"bundle") _bundle "$@" ;;
"test") _test "$@" ;;
"host") _host "$@" ;;
*) _usage "$@" ;;
esac

0 comments on commit 1d4ae00

Please sign in to comment.