We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cfaae36 commit 833b9f2Copy full SHA for 833b9f2
lib/getopts_long.bash
@@ -37,7 +37,10 @@ getopts_long() {
37
# Sanitize and normalize short optspec
38
optspec_short="${optspec_short//-:}"
39
optspec_short="${optspec_short//-}"
40
- [[ "${!OPTIND:0:2}" == "--" ]] && optspec_short+='-:'
+ if [[ -n "${!OPTIND:-}" && "${!OPTIND:0:2}" == "--" ]]; then
41
+ optspec_short+='-:'
42
+ fi
43
+
44
45
builtin getopts -- "${optspec_short}" "${optvar}" "${@}" || return ${?}
46
[[ "${!optvar}" == '-' ]] || return 0
0 commit comments