Skip to content

Commit 7978941

Browse files
akinomyogascop
authored andcommitted
refactor: switch from _xfunc to _comp_xfunc
1 parent 52244e6 commit 7978941

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+160
-124
lines changed

completions/_svn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _svn()
3434
return
3535
;;
3636
--encoding)
37-
_xfunc iconv _iconv_charsets
37+
_comp_xfunc iconv charsets
3838
return
3939
;;
4040
--editor-cmd | --diff-cmd | --diff3-cmd)

completions/_yum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ _yum()
6868
return
6969
;;
7070
remove | erase)
71-
# _rpm_installed_packages is not arch-qualified
71+
# _comp_xfunc_rpm_installed_packages is not arch-qualified
7272
_yum_list installed
7373
return
7474
;;

completions/a2x

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _a2x()
1515
return
1616
;;
1717
--doctype | -!(-*)d)
18-
_xfunc asciidoc _asciidoc_doctype
18+
_comp_xfunc asciidoc doctype
1919
return
2020
;;
2121
--stylesheet)

completions/add_members

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _add_members()
2222
COMPREPLY=($(compgen -W '--regular-members-file --digest-members-file
2323
--welcome-msg --admin-notify --help' -- "$cur"))
2424
else
25-
_xfunc list_lists _mailman_lists
25+
_comp_xfunc list_lists mailman_lists
2626
fi
2727

2828
} &&

completions/apt-build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ _apt_build()
1616
if [[ -v special ]]; then
1717
case $special in
1818
install | source | info)
19-
COMPREPLY=($(_xfunc apt-cache _apt_cache_packages))
19+
COMPREPLY=($(_comp_xfunc apt-cache packages))
2020
;;
2121
remove)
2222
COMPREPLY=(
23-
$(_xfunc dpkg _comp_dpkg_installed_packages "$cur"))
23+
$(_comp_xfunc dpkg installed_packages "$cur"))
2424
;;
2525
esac
2626
return

completions/apt-cache

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
# Debian apt-cache(8) completion -*- shell-script -*-
22

33
# List APT binary packages
4-
_apt_cache_packages()
4+
_comp_xfunc_apt_cache_packages()
55
{
66
apt-cache --no-generate pkgnames "$cur" 2>/dev/null || :
77
}
88

99
# List APT source packages
10-
_apt_cache_sources()
10+
_comp_xfunc_apt_cache_sources()
1111
{
1212
compgen -W "$(apt-cache dumpavail |
1313
awk '$1 == "Source:" { print $2 }' | sort -u)" -- "$1"
1414
}
1515

1616
# List APT source packages
17-
_apt_cache_src_packages()
17+
_comp_xfunc_apt_cache_src_packages()
1818
{
19-
compgen -W '$(_apt_cache_sources "$cur")' -- "$cur"
19+
compgen -W '$(_comp_xfunc_apt_cache_sources "$cur")' -- "$cur"
2020
}
2121

22+
_comp_deprecate_func _apt_cache_packages _comp_xfunc_apt_cache_packages
23+
_comp_deprecate_func _apt_cache_sources _comp_xfunc_apt_cache_sources
24+
_comp_deprecate_func _apt_cache_src_packages _comp_xfunc_apt_cache_src_packages
25+
2226
_apt_cache()
2327
{
2428
local cur prev words cword
@@ -41,11 +45,11 @@ _apt_cache()
4145
;;
4246

4347
showsrc)
44-
COMPREPLY=($(_apt_cache_sources "$cur"))
48+
COMPREPLY=($(_comp_xfunc_apt_cache_sources "$cur"))
4549
;;
4650

4751
*)
48-
COMPREPLY=($(_apt_cache_packages))
52+
COMPREPLY=($(_comp_xfunc_apt_cache_packages))
4953
;;
5054

5155
esac

completions/apt-get

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# Debian apt-get(8) completion -*- shell-script -*-
22

3-
_comp_cmd_apt_get_installed_packages()
3+
_comp_xfunc_apt_get_installed_packages()
44
{
55
if [[ -f /etc/debian_version ]]; then
66
# Debian system
77
COMPREPLY=($(
8-
_xfunc dpkg _comp_dpkg_installed_packages $cur
8+
_comp_xfunc dpkg installed_packages $cur
99
))
1010
else
1111
# assume RPM based
12-
_xfunc rpm _rpm_installed_packages
12+
_comp_xfunc rpm installed_packages
1313
fi
1414
}
1515

16+
_comp_deprecate_func _comp_cmd_apt_get_installed_packages _comp_xfunc_apt_get_installed_packages
17+
1618
_apt_get()
1719
{
1820
local cur prev words cword package
@@ -29,10 +31,10 @@ _apt_get()
2931
if [[ -v special ]]; then
3032
case $special in
3133
remove | auto?(-)remove | purge)
32-
_comp_cmd_apt_get_installed_packages
34+
_comp_xfunc_apt_get_installed_packages
3335
;;
3436
source)
35-
COMPREPLY=($(_xfunc apt-cache _apt_cache_packages)
37+
COMPREPLY=($(_comp_xfunc apt-cache packages)
3638
$(compgen -W "$(apt-cache dumpavail |
3739
awk '$1 == "Source:" { print $2 }' | sort -u)" -- "$cur"))
3840
;;
@@ -59,7 +61,7 @@ _apt_get()
5961
[[ $cur != */* ]] || return
6062
;;&
6163
*)
62-
COMPREPLY+=($(_xfunc apt-cache _apt_cache_packages))
64+
COMPREPLY+=($(_comp_xfunc apt-cache packages))
6365
;;
6466
esac
6567
return

completions/apt-mark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ _comp_cmd_apt_mark()
2727
return
2828
;;
2929
*)
30-
_xfunc apt-get _comp_cmd_apt_get_installed_packages
30+
_comp_xfunc apt-get installed_packages
3131
;;
3232
esac
3333
return

completions/aptitude

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ _aptitude()
3131
install | hold | markauto | unmarkauto | dist-upgrade | full-upgrade | \
3232
safe-upgrade | download | show | changelog | why | why-not | build-dep | \
3333
add-user-tag | remove-user-tag | versions)
34-
COMPREPLY=($(_xfunc apt-cache _apt_cache_packages))
34+
COMPREPLY=($(_comp_xfunc apt-cache packages))
3535
return
3636
;;
3737
purge | remove | reinstall | forbid-version)
3838
COMPREPLY=(
39-
$(_xfunc dpkg _comp_dpkg_installed_packages "$cur"))
39+
$(_comp_xfunc dpkg installed_packages "$cur"))
4040
return
4141
;;
4242
unhold)

completions/arch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _have mailmanctl &&
3232
done
3333
case $args in
3434
1)
35-
_xfunc list_lists _mailman_lists
35+
_comp_xfunc list_lists mailman_lists
3636
;;
3737
2)
3838
_filedir

0 commit comments

Comments
 (0)