setup: handle invalid machine argument more gracefully
If 'setup' is sourced with an invalid machine name, the error message is
now sent to stderr and the failure is propagated back up the stack with
a non-zero return value.
Change-Id: I50ad40b58c1479ce9ee80ea52536075eddd09b4c
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
diff --git a/setup b/setup
index 3b54c0c..cc3414c 100755
--- a/setup
+++ b/setup
@@ -76,7 +76,7 @@
fi
done
- [ -n "$target" ] && echo "No such machine!"
+ [ -n "$target" ] && echo "No such machine!" >&2 && return 1
}
if [ -z "$1" ]; then