@@ -90,17 +90,15 @@ function print_help() {
9090 echo
9191 echo " Usage: $0 analyze"
9292 ;;
93- " start " )
94- echo " Explicitly start the container"
93+ " container " )
94+ echo " Explicitly manage the container"
9595 echo
96- echo " Usage: $0 start"
96+ echo " Usage: $0 container < start|stop|build> "
9797 echo
98- echo " Subsequent commands run on this container instead of starting a new one."
99- ;;
100- " stop" )
101- echo " Explicitly stop the container"
102- echo
103- echo " Usage: $0 stop"
98+ echo " Commands:"
99+ echo " start Start the container"
100+ echo " stop Stop the container"
101+ echo " build Build the container image"
104102 ;;
105103 " shell" )
106104 echo " Run a shell session in the container"
@@ -128,8 +126,7 @@ function print_help() {
128126 echo " unit-test Run unit tests"
129127 echo " integration-test Run integration tests"
130128 echo " analyze Analyze the dart source code"
131- echo " start Explicitly start the container"
132- echo " stop Explicitly stop the container"
129+ echo " container Explicitly manage the container"
133130 echo
134131 echo " See '$0 help <command> for more information on a specific command"
135132 ;;
@@ -326,6 +323,20 @@ function is_container_running() {
326323 fi
327324}
328325
326+ function manage_container() {
327+ case $1 in
328+ start)
329+ start_container tail -f /dev/null
330+ ;;
331+ stop)
332+ stop_container
333+ ;;
334+ build)
335+ build_container
336+ ;;
337+ esac
338+ }
339+
329340function init() {
330341 # Auto-start the container unless already running
331342 is_container_running || auto_start_container
@@ -638,12 +649,6 @@ case "$1" in
638649 print_help ${@: 2}
639650 exit
640651 ;;
641- start)
642- start_container tail -f /dev/null
643- ;;
644- stop)
645- stop_container
646- ;;
647652 build|b)
648653 build ${@: 2}
649654 ;;
@@ -656,6 +661,9 @@ case "$1" in
656661 analyze)
657662 analyze ${@: 2}
658663 ;;
664+ container)
665+ manage_container ${@: 2}
666+ ;;
659667 shell|sh)
660668 init
661669 shell=1
0 commit comments