# shellcheck shell=bash disable=SC2154,2034
___x_cmd_shodan_notifier_info(){
    local X_help_cmd='x help -m shodan notifier info';   help:arg-null:parse
    shodan:arg:format:all
    local id="$1"
    [ -n "$id" ] || N=shodan M="Provide a Notifier ID" log:ret:64

    "___x_cmd_shodan_notifier_info___${format}"
}

___x_cmd_shodan_notifier_info___app(){
    local data; data=$( ___x_cmd_shodan_notifier_info___csv )     || shodan:data:ret
    ___x_cmd_pipevar data  x csv app --return print
}

___x_cmd_shodan_notifier_info___csv(){
    local data; data=$( ___x_cmd_shodan_notifier_info___json )     || shodan:data:ret
    ___x_cmd_pipevar data ___x_cmd_shodan_notifier_info___parse_json2csv
}

___x_cmd_shodan_notifier_info___tsv(){
    local data; data=$( ___x_cmd_shodan_notifier_info___raw )      || shodan:data:ret
    ___x_cmd_pipevar data
}

___x_cmd_shodan_notifier_info___json(){
    local data; data="$( ___x_cmd_shodan_notifier_info___raw )"    || shodan:data:ret
    local error
    ___x_cmd_pipevar data   x jo env . .error   # Consider whether we should take the data
    [ -z "$error" ] || shodan:data:ret
    ___x_cmd_pipevar data
}


___x_cmd_shodan_notifier_info___raw(){
    # shodan:info ___x_cmd_shodan_curl get "/notifier/${id}"
    X_CCMD_TIMEOUT=10m ___x_cmd_shodan_ourl get "/notifier/${id}"
}

___x_cmd_shodan_notifier_info___parse_json2csv(){
    x ja jl2c .id .args.to .provider .description |\
        x csv header --add  ID Type Args_to Provider  Description
}