5858
5959# This function shell-quotes the argument
6060# @deprecated 2.12 Use `_comp_quote` instead. Note that `_comp_quote` stores
61- # the results in the variable `ret ` instead of writing them to stdout.
61+ # the results in the variable `REPLY ` instead of writing them to stdout.
6262quote ()
6363{
6464 local quoted=${1// \' / \'\\\'\' }
@@ -68,33 +68,33 @@ quote()
6868# @deprecated 2.12 Use `_comp_quote_compgen`
6969quote_readline ()
7070{
71- local ret
71+ local REPLY
7272 _comp_quote_compgen " $1 "
73- printf %s " $ret "
73+ printf %s " $REPLY "
7474}
7575
7676# This function is the same as `_comp_quote_compgen`, but receives the second
7777# argument specifying the variable name to store the result.
7878# @param $1 Argument to quote
7979# @param $2 Name of variable to return result to
8080# @deprecated 2.12 Use `_comp_quote_compgen "$1"` instead. Note that
81- # `_comp_quote_compgen` stores the result in a fixed variable `ret `.
81+ # `_comp_quote_compgen` stores the result in a fixed variable `REPLY `.
8282_quote_readline_by_ref ()
8383{
84- [[ $2 == ret ]] || local ret
84+ [[ $2 == REPLY ]] || local REPLY
8585 _comp_quote_compgen " $1 "
86- [[ $2 == ret ]] || printf -v " $2 " %s " $ret "
86+ [[ $2 == REPLY ]] || printf -v " $2 " %s " $REPLY "
8787}
8888
8989# This function shell-dequotes the argument
9090# @deprecated 2.12 Use `_comp_dequote' instead. Note that `_comp_dequote`
91- # stores the results in the array `ret ` instead of writing them to stdout.
91+ # stores the results in the array `REPLY ` instead of writing them to stdout.
9292dequote ()
9393{
94- local ret
94+ local REPLY
9595 _comp_dequote " $1 "
9696 local rc=$?
97- printf %s " $ret "
97+ printf %s " $REPLY "
9898 return $rc
9999}
100100
@@ -198,14 +198,14 @@ _get_pword()
198198
199199# Get real command.
200200# @deprecated 2.12 Use `_comp_realcommand` instead.
201- # Note that `_comp_realcommand` stores the result in the variable `ret `
201+ # Note that `_comp_realcommand` stores the result in the variable `REPLY `
202202# instead of writing it to stdout.
203203_realcommand ()
204204{
205- local ret
205+ local REPLY
206206 _comp_realcommand " $1 "
207207 local rc=$?
208- printf " %s\n" " $ret "
208+ printf " %s\n" " $REPLY "
209209 return $rc
210210}
211211
@@ -328,14 +328,14 @@ _parse_help()
328328 if [[ $1 == - ]]; then
329329 args=(-)
330330 else
331- local ret opt IFS=$' \t\n '
331+ local REPLY opt IFS=$' \t\n '
332332 _comp_dequote " $1 "
333333 _comp_split opt " ${2:- --help} "
334- args=(-c " $ret " ${opt[@]+" ${opt[@]} " } )
334+ args=(-c " $REPLY " ${opt[@]+" ${opt[@]} " } )
335335 fi
336- local -a ret =()
337- _comp_compgen -Rv ret help " ${args[@]} " || return 1
338- (( ${# ret [@]} )) && printf ' %s\n' " ${ret [@]} "
336+ local -a REPLY =()
337+ _comp_compgen -Rv REPLY help " ${args[@]} " || return 1
338+ (( ${# REPLY [@]} )) && printf ' %s\n' " ${REPLY [@]} "
339339 return 0
340340}
341341
@@ -352,23 +352,23 @@ _parse_usage()
352352 if [[ $1 == - ]]; then
353353 args=(-)
354354 else
355- local ret opt IFS=$' \t\n '
355+ local REPLY opt IFS=$' \t\n '
356356 _comp_dequote " $1 "
357357 _comp_split opt " ${2:- --usage} "
358- args=(-c " $ret " ${opt[@]+" ${opt[@]} " } )
358+ args=(-c " $REPLY " ${opt[@]+" ${opt[@]} " } )
359359 fi
360- local -a ret =()
361- _comp_compgen -Rv ret usage " ${args[@]} " || return 1
362- (( ${# ret [@]} )) && printf ' %s\n' " ${ret [@]} "
360+ local -a REPLY =()
361+ _comp_compgen -Rv REPLY usage " ${args[@]} " || return 1
362+ (( ${# REPLY [@]} )) && printf ' %s\n' " ${REPLY [@]} "
363363 return 0
364364}
365365
366366# @deprecated 2.12 Use `_comp_get_ncpus`.
367367_ncpus ()
368368{
369- local ret
369+ local REPLY
370370 _comp_get_ncpus
371- printf %s " $ret "
371+ printf %s " $REPLY "
372372}
373373
374374# Expand variable starting with tilde (~).
@@ -381,14 +381,14 @@ _ncpus()
381381#
382382# @deprecated 2.12 Use `_comp_expand_tilde`. The new function receives the
383383# value instead of a variable name as $1 and always returns the result to the
384- # variable `ret `.
384+ # variable `REPLY `.
385385__expand_tilde_by_ref ()
386386{
387387 [[ ${1+set} ]] || return 0
388- [[ $1 == ret ]] || local ret
388+ [[ $1 == REPLY ]] || local REPLY
389389 _comp_expand_tilde " ${! 1-} "
390390 # shellcheck disable=SC2059
391- [[ $1 == ret ]] || printf -v " $1 " " $ret "
391+ [[ $1 == REPLY ]] || printf -v " $1 " " $REPLY "
392392}
393393
394394# @deprecated 2.12 Use `_comp_compgen -a cd_devices`
@@ -449,7 +449,7 @@ _fstypes()
449449# @deprecated 2.12 Use `_comp_get_first_arg`. Note that the new function
450450# `_comp_get_first_arg` operates on `words` and `cword` instead of `COMP_WORDS`
451451# and `COMP_CWORD`. The new function considers a command-line argument after
452- # `--` as an argument. The new function returns the result in variable `ret `
452+ # `--` as an argument. The new function returns the result in variable `REPLY `
453453# instead of `arg`.
454454_get_first_arg ()
455455{
@@ -471,7 +471,7 @@ _get_first_arg()
471471# @param $3 glob Options that should be counted as args
472472# @var[out] args Return the number of arguments
473473# @deprecated 2.12 Use `_comp_count_args`. Note that the new function
474- # `_comp_count_args` returns the result in variable `ret ` instead of `args`.
474+ # `_comp_count_args` returns the result in variable `REPLY ` instead of `args`.
475475# In the new function, `-` is also counted as an argument. The new function
476476# counts all the arguments after `--`.
477477# shellcheck disable=SC2178 # assignments are not intended for global "args"
0 commit comments