Merge topic 'bash-completion-updates'
2ecf168f
bash-completion: Avoid using _init_completion when not defined
This commit is contained in:
commit
b03063b904
|
@ -3,7 +3,14 @@
|
||||||
_cmake()
|
_cmake()
|
||||||
{
|
{
|
||||||
local cur prev words cword split=false
|
local cur prev words cword split=false
|
||||||
_init_completion -n := || return
|
if type -t _init_completion >/dev/null; then
|
||||||
|
_init_completion -n = || return
|
||||||
|
else
|
||||||
|
# manual initialization for older bash completion versions
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Workaround for options like -DCMAKE_BUILD_TYPE=Release
|
# Workaround for options like -DCMAKE_BUILD_TYPE=Release
|
||||||
local prefix=
|
local prefix=
|
||||||
|
|
|
@ -3,7 +3,14 @@
|
||||||
_cpack()
|
_cpack()
|
||||||
{
|
{
|
||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
|
if type -t _init_completion >/dev/null; then
|
||||||
_init_completion -n = || return
|
_init_completion -n = || return
|
||||||
|
else
|
||||||
|
# manual initialization for older bash completion versions
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
fi
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
-G)
|
-G)
|
||||||
|
|
|
@ -3,7 +3,14 @@
|
||||||
_ctest()
|
_ctest()
|
||||||
{
|
{
|
||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
|
if type -t _init_completion >/dev/null; then
|
||||||
_init_completion -n = || return
|
_init_completion -n = || return
|
||||||
|
else
|
||||||
|
# manual initialization for older bash completion versions
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
fi
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
-C|--build-config)
|
-C|--build-config)
|
||||||
|
|
Loading…
Reference in New Issue