1 2 3 4 5 6 7 8 9 10 11 12 13 14
if (( ! $+commands[scw] )); then return fi _scw () { output=($(scw autocomplete complete zsh -- ${CURRENT} ${words})) opts=('-S' ' ') if [[ $output == *= ]]; then opts=('-S' '') fi compadd "${opts[@]}" -- "${output[@]}" } compdef _scw scw