File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ __argsparse_complete_value() {
148148# # matching long option name. Also if "$cur" should be this option
149149# # value, then return 0.
150150# # @param word any word.
151+ # # @param long... a list of long options.
151152# # @return the long option matching given parameter.
152153# # @retval 0 if given word matches an option and if that option
153154# # accepts a value.
@@ -159,12 +160,9 @@ __argsparse_complete_get_long() {
159160 shift
160161 local -a longs=( " $@ " )
161162 local long
162- if [[ $word = -+ ([! -]) ]] && \
163- long=$( argsparse_short_to_long " ${word: 1: 1} " ) # XXX: change this
163+ if [[ $word = -[! -] ]]
164164 then
165- # -<char><something>, char being a recognized short option
166- # which is wrong.
167- long=$long
165+ long=$( argsparse_short_to_long " ${word# -} " ) || return
168166 elif __argsparse_index_of " $word " " ${longs[@]} " > /dev/null
169167 then
170168 long=${word# --}
You can’t perform that action at this time.
0 commit comments