# shellcheck shell=dash

xrc:mod:lib shodan  cve/count cve/info cve/search

___x_cmd_shodan_cve(){
    [ $# -gt 0 ]    ||  set -- -h

    local op="$1";  shift
    case "$op" in
        info|search|count)
                            "___x_cmd_shodan_cve_${op}"         "$@" ;;
        cve-*|CVE-*)        ___x_cmd_shodan_cve_info   "$op" ;;
        open)               ___x_cmd_shodan_cve_open            "$@" ;;

        -h|--help)          ___x_cmd help -m shodan cve ;;

        *)                  ___x_cmd_shodan_cve_search "$op"    "$@" ;;
    esac
}

___x_cmd_shodan_cve_open(){
    local x_=
    case "$1" in
        api|doc)        x_=docs ;;
        ""|dashboard)   x_=dashboard ;;
        index|intro)    x_=;;
    esac
    ___x_cmd open "https://cvedb.shodan.io/$x_"
}
