PageRenderTime 74ms CodeModel.GetById 72ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion.d/configure

http://github.com/brinkman83/bashrc
#! | 34 lines | 29 code | 5 blank | 0 comment | 0 complexity | 26a29b2422c6952b68e88f3c7da8bd3d MD5 | raw file
 1# bash completion for configure
 2
 3_configure()
 4{
 5    local cur
 6
 7    COMPREPLY=()
 8    cur=`_get_cword`
 9
10    # if $COMP_CONFIGURE_HINTS is not null, then completions of the form
11    # --option=SETTING will include 'SETTING' as a contextual hint
12    [[ "$cur" != -* ]] && return 0
13
14    if [ -n "$COMP_CONFIGURE_HINTS" ]; then
15        COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
16            awk '/^  --[A-Za-z]/ { print $1; \
17            if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \
18            -- "$cur" ) )
19    else
20        COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
21            awk '/^  --[A-Za-z]/ { print $1; \
22            if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' )" \
23            -- "$cur" ) )
24    fi
25}
26complete -F _configure $default configure
27
28# Local variables:
29# mode: shell-script
30# sh-basic-offset: 4
31# sh-indent-comment: t
32# indent-tabs-mode: nil
33# End:
34# ex: ts=4 sw=4 et filetype=sh