4 # Added `capit` because `cap` is a reserved word. `cap` completion doesn't work.
5 # http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module
7 local curcontext="$curcontext" state line ret=1
12 '2:: :->args' && ret=0
15 if [[ -f config/deploy.rb || -f Capfile ]]; then
16 if [[ ! -f .cap_tasks~ ]]; then
17 capit --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~
22 _values 'cap commands' $(< .cap_tasks~)
24 # zmodload zsh/mapfile
25 # _values ${(f)mapfile[.cap_tasks~]}
30 compadd $(find config/deploy -name \*.rb | cut -d/ -f3 | sed s:.rb::g)
35 # check if it uses multistage
36 if [[ -d config/deploy ]]; then