#compdef 0install COMP_CWORD=$CURRENT "${words[1]}" _complete zsh "${words[@]}" |\ while read item do case "$item" in add\ *) compadd -V dontsort -- "${item/#add /}" ;; filter\ *) compadd -- "${item/#filter /}" ;; prefix\ *) compadd -S '' -- "${item/#prefix /}" ;; file) _files ;; "") ;; *) echo 1>&2 Bad reply $item ;; esac done