diff options
Diffstat (limited to 'vbox')
-rwxr-xr-x | vbox | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -8,6 +8,12 @@ BASENAME="`basename $0`" COMMAND="$1" VM="$2" +# Usage +function usage { + echo "usage: $BASENAME <command> [vm]" + exit 1 +} + # Build options if [ ! -z "$VM" ]; then if [ "$COMMAND" == "up" ]; then @@ -19,13 +25,14 @@ if [ ! -z "$VM" ]; then elif [ "$COMMAND" == "halt" ]; then OPTIONS="poweroff" COMMAND="controlvm" + else + usage fi elif [ "$COMMAND" == "status" ]; then OPTIONS="runningvms" COMMAND="list" else - echo "usage: $BASENAME <command> [vm]" - exit 1 + usage fi # Dispatch |