diff options
Diffstat (limited to 'completions/autoconf')
-rw-r--r-- | completions/autoconf | 94 |
1 files changed, 5 insertions, 89 deletions
diff --git a/completions/autoconf b/completions/autoconf index c8f1b195..fea524e7 100644 --- a/completions/autoconf +++ b/completions/autoconf @@ -1,13 +1,9 @@ -# Completions for autoconf tools +# autoconf(1) completion -*- shell-script -*- -have autoconf && _autoconf() { - COMPREPLY=() - local cur prev split=false - _get_comp_words_by_ref cur prev - - _split_longopt && split=true + local cur prev words cword split + _init_completion -s || return case "$prev" in --help|-h|--version|-V|--trace|-t) @@ -32,7 +28,8 @@ _autoconf() $split && return 0 if [[ "$cur" == -* ]]; then - _longopt $1 + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -40,85 +37,4 @@ _autoconf() } && complete -F _autoconf autoconf -have autoreconf || have autoheader && -_autoreconf() -{ - COMPREPLY=() - local cur prev split=false - _get_comp_words_by_ref cur prev - - _split_longopt && split=true - - case "$prev" in - --help|-h|--version|-V) - return 0 - ;; - --warnings|-W) - local cats=( cross gnu obsolete override portability syntax \ - unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) - return 0 - ;; - --prepend-include|-B|--include|-I) - _filedir -d - return 0 - ;; - esac - - $split && return 0 - - if [[ "$cur" == -* ]]; then - _longopt $1 - return 0 - fi - - if [[ $1 == autoheader ]] ; then - _filedir '@(ac|in)' - else - _filedir -d - fi -} && -complete -F _autoreconf autoreconf autoheader - -have autoscan || have autoupdate && -_autoscan() -{ - COMPREPLY=() - local cur prev split=false - _get_comp_words_by_ref cur prev - - _split_longopt && split=true - - case "$prev" in - --help|-h|--version|-V) - return 0 - ;; - --prepend-include|-B|--include|-I) - _filedir -d - return 0 - ;; - esac - - $split && return 0 - - if [[ "$cur" == -* ]]; then - _longopt $1 - return 0 - fi - - if [[ $1 == autoupdate ]] ; then - _filedir '@(ac|in)' - else - _filedir -d - fi -} && -complete -F _autoscan autoscan autoupdate - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: # ex: ts=4 sw=4 et filetype=sh |