1 2 3 4 5 6 7 8 9 10 11 12 13 14
#compdef darcs _darcs() { # 1 based array if (($CURRENT == 2)); then compadd -- $( darcs --commands | grep "^$PREFIX" ) return 0 fi compadd -- $( darcs ${words[2]} --list-option | grep "^$PREFIX" ) return 0 } _darcs "$@"