-z
would return true for an empty string, not for a string containing spaces.
Check if the string consists only of whitespaces. Say:
c ) [[ -z "${OPTARG}" || "${OPTARG}" =~ ^[[:space:]]*$ || "${OPTARG}" == -* ]] \
instead of
c ) [[ -z "${OPTARG}" || "${OPTARG}" == -* ]] \
This would also handle the null (\
) case.
EDIT:
In fact, it can also be written as:
c ) [[ -z "${OPTARG}" || "${OPTARG}" == *[[:space:]]* || "${OPTARG}" == -* ]] \