From 8025bc3a27047b7a33f25fabe0161317233212e8 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 29 Oct 2021 19:38:46 +0200 Subject: configure: Simplify argument parsing --- configure | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/configure b/configure index b0c5f2e..b0a705e 100755 --- a/configure +++ b/configure @@ -74,27 +74,24 @@ CC="${CC:-cc}" CFLAGS="${CFLAGS:--g -O2 -pie -fPIE}" MANDOC="${MANDOC:-mandoc}" -IFS='' # Also allow variables through arguments for i; do case "$i" in - PREFIX=*|BINDIR=*|MANDIR=*|DOCDIR=*|DATADIR=*|APPSDIR=*) - export "${i%%=*}"="${i#*=}" - shift - ;; - PKGCONFIG=*|MSGFMT=*|INKSCAPE=*|CC=*|CFLAGS=*|MANDOC=*) - export "${i%%=*}"="${i#*=}" - shift - ;; - WITH_WEBKITGTK=*|WITH_URI_PARSER=*) - export "${i%%=*}"="${i#*=}" - shift - ;; -h|--help) usage exit 1 ;; + -*) + printf "Unknown argument ā€˜%s’\n" "${i}" + usage + exit 1 + ;; + *=*) + # shellcheck disable=SC2163 + export "$i" + shift + ;; *) printf "Unknown argument ā€˜%s’\n" "${i}" usage -- cgit v1.3.1-26-gb76a