# shellcheck shell=dash disable=SC2154,SC2034
___x_cmd_shodan_dns_reverse(){
    local X_help_cmd='x help -m shodan dns reverse';   help:arg-null:parse
    shodan:arg:format:raw:json2app:all
    [ $# -gt 0 ] ||  N=shodan M="Provide an ip" log:ret:64
    local ips=
    while [ $# -gt 0 ]; do
        case "$1" in
            *)      ips="$ips,$1" ;;
        esac
        shift 1
    done

    ips="${ips#,}"

    shodan:info "Look up the hostnames that have been defined for the given list of [IP addresses=${ips}]"

    ___x_cmd_shodan_dns_reverse___"$format"
}

___x_cmd_shodan_dns_reverse___app(){
    local data; data="$( ___x_cmd_shodan_dns_reverse___raw )"   || shodan:data:ret
    ___x_cmd_pipevar data               x j2y
}

___x_cmd_shodan_dns_reverse___json(){
    local data; data="$( ___x_cmd_shodan_dns_reverse___raw )"   || shodan:data:ret
    ___x_cmd_pipevar data
}

___x_cmd_shodan_dns_reverse___raw(){
    ___x_cmd_shodan_ourl get /dns/reverse --data-urlencode "ips=${ips}"
}
