Skip to content

Commit

Permalink
Fix zsh template script
Browse files Browse the repository at this point in the history
  • Loading branch information
mklabs committed May 20, 2016
1 parent 6de7ca1 commit a22e6b0
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions scripts/zsh.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
###-begin-yo-completion-###
_yo_completion () {
local cword line point words reply
read -Ac words
read -cn cword
let cword-=1
read -l line
read -ln point

###-begin-{pkgname}-completion-###
_{pkgname}_completion () {
local reply
local si=$IFS
IFS=$'\n' reply=($(COMP_CWORD="$cword" COMP_LINE="$line" COMP_POINT="$point" yo-complete completion -- "${words[@]}"))

IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="0" {completer} completion -- "${words[@]}"))
IFS=$si

_describe 'values' reply
}

compdef _yo_completion yo
###-end-yo-completion-###
compdef _{pkgname}_completion {pkgname}
###-end-{pkgname}-completion-###

0 comments on commit a22e6b0

Please sign in to comment.