|
|
@@ -3,10 +3,14 @@
|
|
|
_cmake()
|
|
|
{
|
|
|
local is_old_completion=false
|
|
|
+ local is_init_completion=false
|
|
|
|
|
|
- local cur prev words cword split
|
|
|
- if type -t _init_completion >/dev/null; then
|
|
|
+ local cur prev words cword split was_split
|
|
|
+ if type -t _comp_initialize >/dev/null; then
|
|
|
+ _comp_initialize -s || return
|
|
|
+ elif type -t _init_completion >/dev/null; then
|
|
|
_init_completion -s || return
|
|
|
+ is_init_completion=true
|
|
|
else
|
|
|
# manual initialization for older bash completion versions
|
|
|
COMPREPLY=()
|
|
|
@@ -193,7 +197,11 @@ _cmake()
|
|
|
;;
|
|
|
esac
|
|
|
|
|
|
- $split && return
|
|
|
+ if ($is_old_completion || $is_init_completion); then
|
|
|
+ $split && return
|
|
|
+ else
|
|
|
+ [[ $was_split ]] && return
|
|
|
+ fi
|
|
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
|
COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
|