# HG changeset patch # User Franz Glasner # Date 1726048961 -7200 # Node ID 742cf1eed46307e42f0929c1b08f91d8533e1e8d # Parent b99bcd88b2a3a9eb5147af44ea51299afac860cc common.subr: print the offending argument in error message of _ensure_no_options() diff -r b99bcd88b2a3 -r 742cf1eed463 share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Tue Sep 10 21:12:17 2024 +0200 +++ b/share/local-bsdtools/common.subr Wed Sep 11 12:02:41 2024 +0200 @@ -153,8 +153,8 @@ _ensure_no_options() { local _opt - while getopts ":" _opt ; do - [ "${_opt}" = '?' ] && { echo "ERROR: no option allowed" 1>&2; exit 2; } + while getopts ':' _opt ; do + [ "${_opt}" = '?' ] && fatal 2 "no option allowed (given: -${OPTARG-})" done return 0 }