#_torctl_options="start      - start tor and redirect all traffic through tor.
#stop       - stop tor and redirect all traffic through clearnet.
#status     - get tor service status.
#restart    - restart tor and traffic rules.
#autowipe   - enable memory wipe at shutdown.
#autostart  - start torctl at startup.
#ip         - get remote ip address.
#chngid     - change tor identity.
#chngmac    - change mac addresses of all interfaces.
#rvmac      - revert mac addresses of all interfaces.
#version    - print version of torctl and exit."

_torctl()
{
    local current options
    options="start stop status restart autowipe autostart ip chngid chngmac rvmac version"
    current="${COMP_WORDS[COMP_CWORD]}"
    COMPREPLY=($(compgen -W "${options}" -- ${current}))
}

complete -o nospace -F _torctl torctl