Don't loop infinitely if options are misspelled (or invalid).
[invirt/scripts/invirt-admin.git] / invirt-admin
index 91c73c7..64b02ee 100755 (executable)
@@ -8,7 +8,7 @@ usage () {
     echo "  required options: --name, --fs-size, --swap-size, --memory,"
     echo "    --hostname, --ip, --mac, --arch, --dist, --mirror"
     echo
-    echo "  fs-size, swap-size, memory in MB"
+    echo "  fs-size, swap-size, memory in MiB"
     echo "  fs-size + swap-size will be total disk-image size"
     exit 2
 }
@@ -32,6 +32,11 @@ while [ $# -gt 0 ]; do
        --arch)      arch=$2;      shift 2;;
        --dist)      dist=$2;      shift 2;;
        --mirror)    mirror=$2;    shift 2;;
+        *)
+            echo "Unknown option: $1"
+            echo
+            usage
+            ;;
     esac
 done
 if [ -z "$name" ]; then