# Attention: this is a Bash Script, not `sh`.

#_sploitctl_options="-f <num>  - download exploit archives from chosen sites.
#-u <num>   - update exploit archive from chosen installed archive.
#-d <dir>   - exploits base directory (default: /usr/share/exploits).
#-s <regex> - exploits to search using <regex> in base directory.
#-t <num>   - max parallel downloads (default: 4).
#-r <num>   - max retry failed downloads (default: 3).
#-A         - set useragent string.
#-P         - set proxy (format: proto://user:pass@host:port).
#-X         - decompress archive.
#-R         - remove archive after decompression.
#-V         - print version of sploitctl and exit.
#-H         - print this help and exit."

_sploitctl()
{
    local current options

    options="-f -u -d -s -t -r -A -X -X -R -V -H"

    current="${COMP_WORDS[COMP_CWORD]}"

    if [[ "${current}" == -* ]]; then
        COMPREPLY=($(compgen -W "${options}" -- ${current}))
    fi
}

complete -F _sploitctl sploitctl
