@@ -94,16 +94,18 @@ complete -b builtin
9494
9595# Check if we're running on the given userland
9696# @param $1 userland to check for
97- _userland ()
97+ _comp_userland ()
9898{
9999 local userland=$( uname -s)
100100 [[ $userland == @ (Linux| GNU/* ) ]] && userland=GNU
101101 [[ $userland == " $1 " ]]
102102}
103103
104+ _comp_deprecate_func _userland _comp_userland
105+
104106# This function sets correct SysV init directories
105107#
106- _sysvdirs ()
108+ _comp_sysvdirs ()
107109{
108110 sysvdirs=()
109111 [[ -d /etc/rc.d/init.d ]] && sysvdirs+=(/etc/rc.d/init.d)
@@ -113,32 +115,38 @@ _sysvdirs()
113115 return 0
114116}
115117
118+ _comp_deprecate_func _sysvdirs _comp_sysvdirs
119+
116120# This function checks whether we have a given program on the system.
117121#
118- _have ()
122+ _comp_have_command ()
119123{
120124 # Completions for system administrator commands are installed as well in
121125 # case completion is attempted via `sudo command ...'.
122126 PATH=$PATH :/usr/sbin:/sbin:/usr/local/sbin type $1 & > /dev/null
123127}
124128
129+ _comp_deprecate_func _have _comp_have_command
130+
125131# Backwards compatibility for compat completions that use have().
126132# @deprecated should no longer be used; generally not needed with dynamically
127- # loaded completions, and _have is suitable for runtime use.
133+ # loaded completions, and _comp_have_command is suitable for runtime use.
128134have ()
129135{
130136 unset -v have
131- _have $1 && have=yes
137+ _comp_have_command $1 && have=yes
132138}
133139
134140# This function checks whether a given readline variable
135141# is `on'.
136142#
137- _rl_enabled ()
143+ _comp_readline_variable_on ()
138144{
139145 [[ $( bind -v) == * $1 + ([[:space:]])on* ]]
140146}
141147
148+ _comp_deprecate_func _rl_enabled _comp_readline_variable_on
149+
142150# This function shell-quotes the argument
143151quote ()
144152{
@@ -1439,7 +1447,7 @@ _xinetd_services()
14391447_services ()
14401448{
14411449 local sysvdirs
1442- _sysvdirs
1450+ _comp_sysvdirs
14431451
14441452 _comp_expand_glob COMPREPLY ' ${sysvdirs[0]}/!($_comp_backup_glob|functions|README)'
14451453
@@ -1475,7 +1483,7 @@ _service()
14751483 [[ -e /etc/mandrake-release ]] && _xinetd_services
14761484 else
14771485 local IFS=$' \n ' sysvdirs
1478- _sysvdirs
1486+ _comp_sysvdirs
14791487 COMPREPLY=($( compgen -W ' `command sed -e "y/|/ /" \
14801488 -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \
14811489 ${sysvdirs[0]}/${prev##*/} 2>/dev/null` start stop' -- " $cur " ) )
@@ -1486,7 +1494,7 @@ _service()
14861494_comp__init_set_up_service_completions ()
14871495{
14881496 local sysvdirs svc svcdir
1489- _sysvdirs
1497+ _comp_sysvdirs
14901498 for svcdir in " ${sysvdirs[@]} " ; do
14911499 for svc in " $svcdir " /! ($_comp_backup_glob ); do
14921500 [[ -x $svc ]] && complete -F _service " $svc "
@@ -2065,8 +2073,9 @@ _cd()
20652073 return
20662074 fi
20672075
2068- local -r mark_dirs=$( _rl_enabled mark-directories && echo y)
2069- local -r mark_symdirs=$( _rl_enabled mark-symlinked-directories && echo y)
2076+ local mark_dirs=' ' mark_symdirs=' '
2077+ _comp_readline_variable_on mark-directories && mark_dirs=y
2078+ _comp_readline_variable_on mark-symlinked-directories && mark_symdirs=y
20702079
20712080 # we have a CDPATH, so loop on its contents
20722081 for i in ${CDPATH//:/ $' \n ' } ; do
0 commit comments