Auxiliary: Modernize bash completion for ctest and cpack

This applies a similar modernization as was done in 1ff41ba26e
(Auxiliary: bash-completion: use _comp_initialize, 2024-06-02)
for the cmake executable. The _init_completion function was
deprecated upstream in bash-completion 2.12.
This commit is contained in:
Craig Scott 2024-06-07 18:48:46 +10:00
parent aa72c5e319
commit 3889640e8b
No known key found for this signature in database
GPG Key ID: 6FF37CBDCCADED9F
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,9 @@
_cpack()
{
local cur prev words cword
if type -t _init_completion >/dev/null; then
if type -t _comp_initialize >/dev/null; then
_comp_initialize -n = || return
elif type -t _init_completion >/dev/null; then
_init_completion -n = || return
else
# manual initialization for older bash completion versions

View File

@ -3,7 +3,9 @@
_ctest()
{
local cur prev words cword
if type -t _init_completion >/dev/null; then
if type -t _comp_initialize >/dev/null; then
_comp_initialize -n = || return
elif type -t _init_completion >/dev/null; then
_init_completion -n = || return
else
# manual initialization for older bash completion versions