From 346825df86466cf151be61b9429ef2c1734e66ea Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 27 Jun 1999 05:33:04 +0000 Subject: zsh-3.1.5-pws-24 --- Completion/User/_make | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'Completion/User/_make') diff --git a/Completion/User/_make b/Completion/User/_make index 4770c0d7a..add58dbf0 100644 --- a/Completion/User/_make +++ b/Completion/User/_make @@ -1,4 +1,24 @@ #compdef make gmake pmake -compgen -s "\$(awk '/^[a-zA-Z0-9][^\/ ]+:/ {print \$1}' FS=: [mM]akefile /dev/null)" || -_files +local prev="$words[CURRENT-1]" file ret=1 + +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 + + [[ -n "$file" ]] && + compadd - $(awk '/^[a-zA-Z0-9][^/ ]+:/ {print $1}' FS=: $file) && ret=0 + (( ret )) && _files +fi -- cgit 1.4.1