_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
}
compdef _darcs darcs

