Skip to content

Commit cbc49a8

Browse files
committed
refactor: rename _{ => comp}_load_completion
1 parent 479acfd commit cbc49a8

File tree

16 files changed

+23
-22
lines changed

16 files changed

+23
-22
lines changed

bash_completion

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,8 +2929,8 @@ _minimal()
29292929
# https://lists.gnu.org/archive/html/bug-bash/2012-01/msg00045.html
29302930
complete -F _minimal ''
29312931
2932-
# TODO:API: rename per conventions
2933-
__load_completion()
2932+
# @since 2.12
2933+
_comp_load()
29342934
{
29352935
local cmd=$1 cmdname=${1##*/} dir compfile
29362936
local -a paths
@@ -3051,7 +3051,7 @@ _completion_loader()
30513051
# $1=_EmptycmD_ already for empty cmds in bash 4.3, set to it for earlier
30523052
local cmd=${1:-_EmptycmD_}
30533053
3054-
__load_completion "$cmd" && return 124
3054+
_comp_load "$cmd" && return 124
30553055
30563056
# Need to define *something*, otherwise there will be no completion at all.
30573057
complete -F _minimal -- "$cmd" && return 124
@@ -3071,7 +3071,7 @@ _comp_xfunc()
30713071
local xfunc_name=$2
30723072
[[ $xfunc_name == _* ]] ||
30733073
xfunc_name=_comp_xfunc_${1//[^a-zA-Z0-9_]/_}_$xfunc_name
3074-
declare -F "$xfunc_name" &>/dev/null || __load_completion "$1"
3074+
declare -F "$xfunc_name" &>/dev/null || _comp_load "$1"
30753075
"$xfunc_name" "${@:3}"
30763076
}
30773077

bash_completion.d/000_bash_completion_compat.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ _comp_deprecate_func 2.12 _installed_modules _comp_compgen_inserted_kernel_modul
3030
_comp_deprecate_func 2.12 _usergroup _comp_compgen_usergroup
3131
_comp_deprecate_func 2.12 _complete_as_root _comp_as_root
3232
_comp_deprecate_func 2.12 _included_ssh_config_files _comp__included_ssh_config_files
33+
_comp_deprecate_func 2.12 __load_completion _comp_load
3334

3435
# Backwards compatibility for compat completions that use have().
3536
# @deprecated 1.90 should no longer be used; generally not needed with

completions/_cargo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# This serves as a fallback in case the completion is not installed otherwise.
44

5-
# shellcheck disable=SC2168 # "local" is ok, assume sourced by __load_completion
5+
# shellcheck disable=SC2168 # "local" is ok, assume sourced by _comp_load
66
local rustup="${1%cargo}rustup" # use rustup from same dir
77
eval -- "$("$rustup" completions bash cargo 2>/dev/null)"
88

File renamed without changes.
File renamed without changes.
File renamed without changes.

test/fixtures/__load_completion/prefix1/share/bash-completion/completions/cmd1 renamed to test/fixtures/_comp_load/prefix1/share/bash-completion/completions/cmd1

File renamed without changes.

test/fixtures/__load_completion/prefix1/share/bash-completion/completions/cmd2 renamed to test/fixtures/_comp_load/prefix1/share/bash-completion/completions/cmd2

File renamed without changes.

0 commit comments

Comments
 (0)