@@ -10,8 +10,10 @@ _comp_deprecate_func 2.12 _root_command _comp_root_command
1010_comp_deprecate_func 2.12 _xfunc _comp_xfunc
1111_comp_deprecate_func 2.12 _upvars _comp_upvars
1212_comp_deprecate_func 2.12 _get_comp_words_by_ref _comp_get_words
13+ _comp_deprecate_func 2.12 _known_hosts_real _comp_compgen_known_hosts
1314_comp_deprecate_func 2.12 _longopt _comp_longopt
1415_comp_deprecate_func 2.12 __ltrim_colon_completions _comp_ltrim_colon_completions
16+ _comp_deprecate_func 2.12 _variables _comp_compgen_variables
1517_comp_deprecate_func 2.12 _signals _comp_compgen_signals
1618_comp_deprecate_func 2.12 _mac_addresses _comp_compgen_mac_addresses
1719_comp_deprecate_func 2.12 _available_interfaces _comp_compgen_available_interfaces
@@ -21,6 +23,9 @@ _comp_deprecate_func 2.12 _kernel_versions _comp_compgen_kernel_versions
2123_comp_deprecate_func 2.12 _uids _comp_compgen_uids
2224_comp_deprecate_func 2.12 _gids _comp_compgen_gids
2325_comp_deprecate_func 2.12 _xinetd_services _comp_compgen_xinetd_services
26+ _comp_deprecate_func 2.12 _services _comp_compgen_services
27+ _comp_deprecate_func 2.12 _bashcomp_try_faketty _comp_try_faketty
28+ _comp_deprecate_func 2.12 _expand _comp_expand
2429_comp_deprecate_func 2.12 _pids _comp_compgen_pids
2530_comp_deprecate_func 2.12 _pgids _comp_compgen_pgids
2631_comp_deprecate_func 2.12 _pnames _comp_compgen_pnames
@@ -359,6 +364,26 @@ _ncpus()
359364 printf %s " $ret "
360365}
361366
367+ # Expand variable starting with tilde (~).
368+ # We want to expand ~foo/... to /home/foo/... to avoid problems when
369+ # word-to-complete starting with a tilde is fed to commands and ending up
370+ # quoted instead of expanded.
371+ # Only the first portion of the variable from the tilde up to the first slash
372+ # (~../) is expanded. The remainder of the variable, containing for example
373+ # a dollar sign variable ($) or asterisk (*) is not expanded.
374+ #
375+ # @deprecated 2.12 Use `_comp_expand_tilde`. The new function receives the
376+ # value instead of a variable name as $1 and always returns the result to the
377+ # variable `ret`.
378+ __expand_tilde_by_ref ()
379+ {
380+ [[ ${1+set} ]] || return 0
381+ [[ $1 == ret ]] || local ret
382+ _comp_expand_tilde " ${! 1-} "
383+ # shellcheck disable=SC2059
384+ [[ $1 == ret ]] || printf -v " $1 " " $ret "
385+ } # __expand_tilde_by_ref()
386+
362387# @deprecated 2.12 Use `_comp_compgen -a cd_devices`
363388_cd_devices ()
364389{
@@ -401,6 +426,12 @@ _allowed_groups()
401426 _comp_compgen -c " ${1:- $cur } " allowed_groups
402427}
403428
429+ # @deprecated 2.12 Use `_comp_compgen -a shells`
430+ _shells ()
431+ {
432+ _comp_compgen -a shells
433+ }
434+
404435# @deprecated 2.12 Use `_comp_compgen -a fstypes`
405436_fstypes ()
406437{
0 commit comments