Skip to content

Commit fda7893

Browse files
committed
feat(ARRAY): use REPLY to return values
1 parent 270cdc6 commit fda7893

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

completions/ARRAY

+5-5
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ _comp_uniq()
208208
}
209209

210210
# Obtain the largest index
211-
# @var[out] ret
211+
# @var[out] REPLY
212212
# @version bash-4.3
213213
_comp_last_index()
214214
{
215215
local -n _comp_last_index__array=$1
216216
local -a _comp_last_index__indices=("${!_comp_last_index__array[@]}")
217-
ret=${_comp_last_index__indices[*]: -1}
217+
REPLY=${_comp_last_index__indices[*]: -1}
218218
}
219219

220220
# @version bash-4.3
@@ -251,7 +251,7 @@ _comp_xfunc_ARRAY_reverse()
251251
#
252252
# -l Get the last index of matching elements.
253253
#
254-
# @var[out] ret
254+
# @var[out] REPLY
255255
# @version bash-4.3
256256
_comp_index_of()
257257
{
@@ -291,7 +291,7 @@ _comp_index_of()
291291
fi
292292
[[ $_old_nocasematch ]] && shopt -s nocasematch
293293

294-
ret=-1
294+
REPLY=-1
295295

296296
local -n _array=$1
297297
if ((${#_array[@]})); then
@@ -306,7 +306,7 @@ _comp_index_of()
306306
_comp_xfunc_ARRAY__predicate "${_array[_i]}"
307307
case $? in
308308
0)
309-
ret=$_i
309+
REPLY=$_i
310310
return 0
311311
;;
312312
1) continue ;;

0 commit comments

Comments
 (0)