# shellcheck shell=dash disable=SC2154,SC2034
___x_cmd_shodan_dns_resolve(){
    local X_help_cmd='x help -m shodan dns resolve';   help:arg-null:parse
    shodan:arg:format:raw:json2app:all
    [ $# -gt 0 ] ||  N=shodan M="Provide a hostname" log:ret:64

    local host_names
    while [ $# -gt 0 ]; do
        case "$1" in
            *)      host_names="$host_names,$1" ;;
        esac
        shift 1
    done
    host_names="${host_names#,}"
    shodan:info "Look up the IP address for the provided list of [hostname=${host_names}]"

    ___x_cmd_shodan_dns_resolve___"$format"
}

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

___x_cmd_shodan_dns_resolve___json(){
    local data; data="$( ___x_cmd_shodan_dns_resolve___raw )"   || shodan:data:ret
    ___x_cmd_pipevar data
}

___x_cmd_shodan_dns_resolve___raw(){
    ___x_cmd_shodan_ourl get /dns/resolve --data-urlencode "hostnames=${host_names}"
}
