summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure12
1 files changed, 10 insertions, 2 deletions
diff --git a/configure b/configure
index b9ddeb9..4e8d03a 100755
--- a/configure
+++ b/configure
@@ -71,6 +71,11 @@ ${features}"
main()
{
parse_options "${@}"
+ shift ${optind}
+ if [ ${#} -ne 0 ]; then
+ print_usage
+ exit
+ fi
for dep in ${dep_cmds}; do
dep_name="$(printf '%s' "${dep}" | tr -c '[a-z0-9]' '_')"
@@ -181,6 +186,8 @@ EOF
parse_options()
{
+ optind=0
+
for _opt; do
# Handle arguments of "--opt arg" options.
@@ -234,8 +241,7 @@ parse_options()
_type='option'
;;
*)
- printf 'unrecognized option: %s\n' "${_opt}" >&2
- exit 1
+ break
;;
esac
@@ -253,6 +259,8 @@ EOF
_prev="${_opt}"
fi
+ optind=$(($optind + 1))
+
done
}