oops
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 1 Jun 2011 09:17:13 +0000 (11:17 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 1 Jun 2011 09:17:13 +0000 (11:17 +0200)
scripts/create-vm.sh

index b6d477d..8987106 100755 (executable)
@@ -13,7 +13,7 @@ INTERACTIVE=
 DISTRO=$DEFAULT_DISTRO
 PERSO=$DEFAULT_PERSO
 function usage () {
-  message="$1" ; shift
+  message="$@" 
   echo "usage : $COMMAND [-i] [-f distro] [-p perso] hostname"
   echo "  default distro is $DEFAULT_DISTRO"
   echo "  default perso is $DEFAULT_PERSO"
@@ -21,7 +21,7 @@ function usage () {
   exit 1
 }
 
-while getopts "fp:ih" flag; do
+while getopts "f:p:ih" flag; do
     case $flag in
        f) DISTRO=$OPTARG;;
        p) PERSO=$OPTARG;;
@@ -32,7 +32,7 @@ done
 shift $((OPTIND-1))
 [[ -z "$@" ]] && usage "no hostname provided"
 HOSTNAME="$1" ; shift
-[[ -n "$@" ]] && usage "extra arguments"
+[[ -n "$@" ]] && usage "extra arguments"  "$@" "(hostname=$HOSTNAME)"
 
 
 [ -d "$BUILD" ] || usage "Could not find directory $BUILD"