#compdef nextdns
_nextdns() {
    if (( CURRENT == 2 )); then
        compadd -- install uninstall start stop restart status log upgrade run config activate deactivate discovered cache-stats cache-keys trace arp ndp version completion
        return
    fi
    if [[ ${words[2]} == config && CURRENT == 3 ]]; then
        compadd -- list set edit wizard
    fi
}
compdef _nextdns nextdns
