mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-12 11:01:15 +02:00
25 lines
554 B
Text
25 lines
554 B
Text
#compdef make gmake pmake
|
|
|
|
local prev="$words[CURRENT-1]" file ret=1 expl
|
|
|
|
if [[ "$prev" = -[CI] ]]; then
|
|
_files -/
|
|
elif [[ "$prev" = -[foW] ]]; then
|
|
_files
|
|
else
|
|
file="$words[(I)-f]"
|
|
if (( file )); then
|
|
file="$words[file+1]"
|
|
elif [[ -e Makefile ]]; then
|
|
file=Makefile
|
|
elif [[ -e makefile ]]; then
|
|
file=makefile
|
|
else
|
|
file=''
|
|
fi
|
|
|
|
_description expl 'make target'
|
|
[[ -n "$file" ]] &&
|
|
compadd "$expl[@]" - $(awk '/^[a-zA-Z0-9][^\/ ]+:/ {print $1}' FS=: $file) && ret=0
|
|
(( ret )) && { compset -P 1 '*\='; _files }
|
|
fi
|