diff --git a/completions/autoconf b/completions/autoconf index 0eb2ca66..10d80cff 100644 --- a/completions/autoconf +++ b/completions/autoconf @@ -43,10 +43,10 @@ complete -F _autoconf autoconf have autoreconf || have autoheader && _autoreconf() { - COMPREPLY=() - local cur prev split=false - _get_comp_words_by_ref cur prev + local cur prev words cword + _init_completion || return + local split=false _split_longopt && split=true case "$prev" in @@ -84,10 +84,10 @@ complete -F _autoreconf autoreconf autoheader have autoscan || have autoupdate && _autoscan() { - COMPREPLY=() - local cur prev split=false - _get_comp_words_by_ref cur prev + local cur prev words cword + _init_completion || return + local split=false _split_longopt && split=true case "$prev" in diff --git a/completions/automake b/completions/automake index 1671d117..19a49f3a 100644 --- a/completions/automake +++ b/completions/automake @@ -39,10 +39,10 @@ complete -F _automake automake automake-1.11 have aclocal && _aclocal() { - COMPREPLY=() - local cur prev split=false - _get_comp_words_by_ref cur prev + local cur prev words cword + _init_completion || return + local split=false _split_longopt && split=true case "$prev" in diff --git a/completions/ifupdown b/completions/ifupdown index 372fe7b9..776279c4 100644 --- a/completions/ifupdown +++ b/completions/ifupdown @@ -7,7 +7,7 @@ _ifupdown() local cur prev words cword _init_completion || return - if [ $COMP_CWORD -eq 1 ]; then + if [ $cword -eq 1 ]; then _configured_interfaces COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) fi diff --git a/completions/mailman b/completions/mailman index 62f5cb42..457ac336 100644 --- a/completions/mailman +++ b/completions/mailman @@ -8,10 +8,8 @@ _mailman_lists() _list_lists() { - local cur - - COMPREPLY=() - _get_comp_words_by_ref cur + local cur prev words cword + _init_completion || return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \ @@ -359,8 +357,6 @@ _arch() _init_completion || return local split=false - _get_comp_words_by_ref cur prev - _split_longopt && split=true case $prev in diff --git a/completions/portupgrade b/completions/portupgrade index be3be916..834b02ba 100644 --- a/completions/portupgrade +++ b/completions/portupgrade @@ -28,7 +28,7 @@ _portinstall() local -a COMPREPLY2 portsdir=${PORTSDIR:-/usr/ports}/ - _get_comp_words_by_ref cur prev + # First try INDEX-5 indexfile=$portsdir/INDEX-5 # Then INDEX if INDEX-5 does not exist or system is not FreeBSD 5.x