The function did not recognize option combining. For example, the
current word was not recognized as an argument to -c if -c was given
as -abc. This patch should fix this issue.
opt="${opts:$i:1}"
[[ "${opts:$(($i + 1)):1}" != ":" ]] && continue
let i++
opt="${opts:$i:1}"
[[ "${opts:$(($i + 1)):1}" != ":" ]] && continue
let i++
- [[ "$prev" != "-$opt" ]] && continue
+ [[ ! "$prev" =~ ^-.*$opt$ ]] && continue
result="$opt"
return
done
result="$opt"
return
done