patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH ucspi-vsock] configure: reject invalid arguments
Date: Sun, 21 Mar 2021 19:39:51 +0000	[thread overview]
Message-ID: <20210321193951.21671-1-hi@alyssa.is> (raw)

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

             reply	other threads:[~2021-03-21 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 19:39 Alyssa Ross [this message]
2021-03-22  0:18 ` Cole Helbling
2021-03-22 12:16   ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210321193951.21671-1-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).