diff options
author | P. J. McDermott <pjm@nac.net> | 2012-10-08 22:22:52 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-10-08 22:22:52 (EDT) |
commit | fb96a4650e82f79eb0afb26e45c0ff77f1013228 (patch) | |
tree | c37db1719b010320bc694a61a315bd3602198ed6 /configure | |
parent | fbc574413b2bbc7417d2baca1b9878916a19ed6c (diff) |
Improve non-option argument handling in configure.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 } |