Fix unparsed options checking regex.

Sould only catch options, not arguments with dashes in them.
This commit is contained in:
Pedro Algarvio 2014-01-04 13:53:56 +00:00
parent b8464781cf
commit 9387bf484d

View file

@ -303,7 +303,7 @@ __check_unparsed_options() {
else
grep='grep'
fi
unparsed_options=$( echo "$shellopts" | ${grep} -E '[-]+[[:alnum:]][[:blank:]]' )
unparsed_options=$( echo "$shellopts" | ${grep} -E '(^|[[:space:]])[-]+[[:alnum:]]' )
if [ "x$unparsed_options" != "x" ]; then
usage
echo