[PATCH ucspi-vsock] configure: reject invalid arguments

Alyssa Ross
2021-03-21T19:40:18Z

But we preserve the autoconf behaviour of only warning on invalid
options.

$ ./configure --test
Warning: unrecognized options: --test

$ ./configure test
Error: unexpected argument: test
---
configure | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 38c926c..938db10 100755
--- a/configure
+++ b/configure
@@ -29,8 +29,11 @@ for arg; do
prefix="$(printf "%s" "$arg" | cut -d= -f2-)"
elif printf "%s" "$arg" | grep -q "^--bindir="; then
bindir="$(printf "%s" "$arg" | cut -d= -f2-)"
- else
+ elif printf "%s" "$arg" | grep -q "^--"; then
unrecognized="$unrecognized $arg"
+ else
+ echo "Error: unexpected argument: $arg" >&2
+ exit 64 # EX_USAGE
fi
done

--
2.30.0