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
On Sun Mar 21, 2021 at 12:39 PM PDT, Alyssa Ross wrote:
> 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(-)
Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
[-- Attachment #1: Type: text/plain, Size: 524 bytes --] On Sun, Mar 21, 2021 at 05:18:33PM -0700, Cole Helbling wrote: > On Sun Mar 21, 2021 at 12:39 PM PDT, Alyssa Ross wrote: > > 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(-) > > Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com> Committed as 6fb32b8. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]