2009-06-08 16:51:48 +02:00
|
|
|
# bash completion for configure
|
|
|
|
|
|
|
|
_configure()
|
|
|
|
{
|
2009-10-04 19:42:50 +02:00
|
|
|
local cur
|
2009-06-08 16:51:48 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=()
|
|
|
|
cur=`_get_cword`
|
2009-06-08 16:51:48 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# if $COMP_CONFIGURE_HINTS is not null, then completions of the form
|
|
|
|
# --option=SETTING will include 'SETTING' as a contextual hint
|
|
|
|
[[ "$cur" != -* ]] && return 0
|
2009-06-08 16:51:48 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
if [ -n "$COMP_CONFIGURE_HINTS" ]; then
|
|
|
|
COMPREPLY=( $( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \
|
|
|
|
if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | \
|
|
|
|
grep ^$cur ) )
|
|
|
|
else
|
|
|
|
COMPREPLY=( $( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \
|
|
|
|
if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | \
|
|
|
|
grep ^$cur ) )
|
|
|
|
fi
|
2009-06-08 16:51:48 +02:00
|
|
|
}
|
2009-10-22 12:04:29 +03:00
|
|
|
complete -F _configure -o default configure
|
2009-10-01 20:54:51 +03:00
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
2009-10-04 19:42:50 +02:00
|
|
|
# sh-basic-offset: 4
|
2009-10-01 20:54:51 +03:00
|
|
|
# sh-indent-comment: t
|
2009-10-04 19:42:50 +02:00
|
|
|
# indent-tabs-mode: nil
|
2009-10-01 20:54:51 +03:00
|
|
|
# End:
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|