diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-23 04:19:26 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-23 04:19:26 +0000 |
commit | 626e2aeb1657f112feb6d03c34bb9e9f44764c75 (patch) | |
tree | 9e4a306df7b5826a796b99f0b6ffa3423ee9f5f9 /Completion/User/_make | |
parent | 766fcd5ee2ef632cd982a1ec118dbdfde17c03a8 (diff) | |
download | zsh-626e2aeb1657f112feb6d03c34bb9e9f44764c75.tar.gz zsh-626e2aeb1657f112feb6d03c34bb9e9f44764c75.tar.xz zsh-626e2aeb1657f112feb6d03c34bb9e9f44764c75.zip |
zsh-workers/10195
Diffstat (limited to 'Completion/User/_make')
-rw-r--r-- | Completion/User/_make | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Completion/User/_make b/Completion/User/_make index aaae444a8..dc08d4e26 100644 --- a/Completion/User/_make +++ b/Completion/User/_make @@ -1,6 +1,6 @@ #compdef make gmake pmake -local prev="$words[CURRENT-1]" file ret=1 expl +local prev="$words[CURRENT-1]" file expl tmp if [[ "$prev" = -[CI] ]]; then _files -/ @@ -18,11 +18,15 @@ else file='' fi - [[ -n "$file" ]] && _wanted targets expl 'make target' && - compadd "$expl[@]" - \ + 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) && ret=0 - (( ret )) && { compset -P 1 '*='; _files } + FS=: $file) + ) + _loop targets expl 'make target' compadd "$tmp[@]" && return 0 + fi + compset -P 1 '*=' + _files fi |