diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-01 20:43:43 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-01 20:43:43 +0000 |
commit | e025336f2f6d9f107ee1e03b9900f04af0544ba9 (patch) | |
tree | 37b0ce74587d42d4bcb024991526d2361fcdf04a /Completion/User/_make | |
parent | 20c5fbe688f24010c578c48d4b4d228f0e1a56c3 (diff) | |
download | zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.gz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.xz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.zip |
Updated from list as far as 10376
Diffstat (limited to 'Completion/User/_make')
-rw-r--r-- | Completion/User/_make | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/Completion/User/_make b/Completion/User/_make index d576b0308..741cbb7dc 100644 --- a/Completion/User/_make +++ b/Completion/User/_make @@ -1,3 +1,32 @@ -#defcomp make gmake pmake +#compdef make gmake pmake -complist -s "\$(awk '/^[a-zA-Z0-9][^/ ]+:/ {print \$1}' FS=: [mM]akefile)" +local prev="$words[CURRENT-1]" file expl tmp + +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 + + if [[ -n "$file" ]] && _wanted targets; then + tmp=( + $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1} + /^\.include *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ { + print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \ + FS=: $file) + ) + _all_labels targets expl 'make target' compadd "$tmp[@]" && return 0 + fi + compset -P 1 '*=' + _files +fi |