# ZSH completion for t2fm

_t2fm() {
    #compdef t2fm

    local opts=(
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-i,--iface}'[Interface to capture traffic from]:interface:_net_interfaces'
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-r,--pcap}'[PCAP file to analyse]:file:_files'
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-R,--pcap-list}'[List of PCAP files to analyse]:file:_files'
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-F,--flow-file}'[Flow file to analyse]:file:_files'
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-c,--clickhouse}'[ClickHouse database name]:name:'
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-m,--mongo}'[Mongo database name]:name:'
        '(-i --iface -r --pcap -R --pcap-list -F --flow-file -c --clickhouse -m --mongo -p --postgres)'{-p,--postgres}'[PostgreSQL database name]:name:'
        {-A,--open-pdf}'[Automatically open the generated PDF]'
        {-w,--output-prefix}'[Append PREFIX to any output file produced]:output prefix:_files'
        #'-T[Only consider data between FROM and TO (-m and -p only)]:1: from 2: to:'
        {-b,--build}'[Configure and build Tranalyzer2 and the plugins]'
        '--reset[Reset T2 and the plugins configuration at the end]'
        {-f,--hash-factor}'[hashfactor]:Multiplication factor for hash table (int):'
        '--hide-user[Do not output usernames for cleartext passwords]'
        '--hide-pass[Do not output passwords for cleartext passwords]'
        '--hide-user-pass[Do not output usernames or passwords for cleartext passwords]'
        '--no-countries[Do not output top countries]'
        '--no-organisations[Do not output top organisations]'
        '--no-non-std-ports[Do not output non-standard ports statistics]'
        '--no-dns[Do not output DNS statistics]'
        '--no-http[Do not output HTTP statistics]'
        '--no-https[Do not output HTTPS statistics]'
        '--no-ssh[Do not output SSH statistics]'
        '--no-passwords[Do not output cleartext passwords]'
        '--no-warnings[Do not output the warnings section]'
        {-t,--title}'[title]:Set the report title:'
        {-a,--author}'[author]:Set the report author:'
        {-C,--color}'[color]:Set the chart color:'
        {-L,--no-log-axis}'[Do not use logarithmic scale for axis]'
        {-n,--table-n}'[num]:Compute top num statistics for tables (int):'
        {-c,--chart-n}'[num]:Compute top num statistics for charts (int):'
        {-H,--raw-numbers}'[Output raw numbers instead of human readable]'
        {-HH,--raw-and-hdrnum}'[Output raw and human readable numbers]'
        #'(-0 -1)'{-0,-0}'[Run all queries in parallel]'
        #'(-0 -1)'{-1,-1}'[Do not run queries in parallel (slow)]'
        '--copyright[text]:Print a copyright notice at the bottom of every page:'
        '--watermark[text]:Print a watermark on every page'
        {-y,--yes}'[Do not ask for confirmation before executing an action]'
        '(- 1 *)'{-h,--help}'[Show help options and exit]'
    )

    _arguments -s -S "${opts[@]}"
}

compdef _t2fm t2fm
