Skip to content

Commit 0c68008

Browse files
committed
refactor: rename _{ => comp}_load_completion
1 parent b3a5d25 commit 0c68008

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
@@ -2927,8 +2927,8 @@ _minimal()
29272927
# https://lists.gnu.org/archive/html/bug-bash/2012-01/msg00045.html
29282928
complete -F _minimal ''
29292929
2930-
# TODO:API: rename per conventions
2931-
__load_completion()
2930+
# @since 2.12
2931+
_comp_load()
29322932
{
29332933
local cmd=$1 cmdname=${1##*/} dir compfile
29342934
local -a paths
@@ -3049,7 +3049,7 @@ _completion_loader()
30493049
# $1=_EmptycmD_ already for empty cmds in bash 4.3, set to it for earlier
30503050
local cmd=${1:-_EmptycmD_}
30513051
3052-
__load_completion "$cmd" && return 124
3052+
_comp_load "$cmd" && return 124
30533053
30543054
# Need to define *something*, otherwise there will be no completion at all.
30553055
complete -F _minimal -- "$cmd" && return 124
@@ -3069,7 +3069,7 @@ _comp_xfunc()
30693069
local xfunc_name=$2
30703070
[[ $xfunc_name == _* ]] ||
30713071
xfunc_name=_comp_xfunc_${1//[^a-zA-Z0-9_]/_}_$xfunc_name
3072-
declare -F "$xfunc_name" &>/dev/null || __load_completion "$1"
3072+
declare -F "$xfunc_name" &>/dev/null || _comp_load "$1"
30733073
"$xfunc_name" "${@:3}"
30743074
}
30753075

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)