make: Add generic variable completion.

This commit is contained in:
Ville Skyttä 2012-05-11 23:28:57 +03:00
parent ccda61d928
commit f7240b82a4

View File

@ -37,6 +37,12 @@ _make()
[[ $opts ]] || opts="$( _parse_usage "$1" )" [[ $opts ]] || opts="$( _parse_usage "$1" )"
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY == *= ]] && compopt -o nospace
elif [[ $cur == *=* ]]; then
prev=${cur%%=*}
cur=${cur#*=}
local diropt
[[ ${prev,,} == *dir?(ectory) ]] && diropt=-d
_filedir $diropt
else else
# before we check for makefiles, see if a path was specified # before we check for makefiles, see if a path was specified
# with -C/--directory # with -C/--directory