# shellcheck shell=dash disable=SC2154,2034
___x_cmd_shodan_alert_trigger_ls(){
    local X_help_cmd='x help -m shodan alert trigger ls';   help:arg:parse
    shodan:arg:format:all
    shodan:info "Obtain a list of available triggers"

    "___x_cmd_shodan_alert_trigger_ls___${format}"
}

___x_cmd_shodan_alert_trigger_ls___app(){
    local data; data=$(___x_cmd_shodan_alert_trigger_ls___raw)      || shodan:data:ret
    ___x_cmd_pipevar data ___x_cmd_shodan_alert_trigger_ls___parse_json2csv |\
        x csv app --width 30%,30%,30% --return print
}


___x_cmd_shodan_alert_trigger_ls___csv(){
    local data; data=$(___x_cmd_shodan_alert_trigger_ls___raw)      || shodan:data:ret
    ___x_cmd_pipevar data ___x_cmd_shodan_alert_trigger_ls___parse_json2csv
}

___x_cmd_shodan_alert_trigger_ls___json(){
    local data; data="$(___x_cmd_shodan_alert_trigger_ls___raw)"    || shodan:data:ret
    ___x_cmd_pipevar data
}

___x_cmd_shodan_alert_trigger_ls___raw(){
    ___x_cmd_shodan_ourl get "/shodan/alert/triggers"
}

___x_cmd_shodan_alert_trigger_ls___parse_json2csv(){
    x ja 2c .name .rule .description |\
        x csv header --add  Name Rule  Description
}

___x_cmd_shodan_alert_trigger_ll(){
    local X_help_cmd='x help -m shodan alert trigger ll';   help:arg:parse
    local data; data=$(___x_cmd_shodan_alert_trigger_ls___raw)      || shodan:data:ret
    ___x_cmd_pipevar data ___x_cmd_shodan_alert_trigger_ls___parse_json2csv |\
         x csv static_tab
}


