_catall_completions()
{
    local cur prev

    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    local opts="
        -r --recursive
        -A --absolute
        -S --simple
        -D --dir-headers
        -L --follow-symlinks
        -q --quiet
        -b --binary
        -M --no-max-size
        -a --archives
        -h --help
        --version
        --list-extcols
        --show-skipped
        --show-skipped-reasons
        --include-hidden
        --no-gitignore
        -H --header
        --dir-header
        -s --separator
        -e --ext
        --extcol
        --exclude-ext
        -x --exclude
        -T --limit-text
        -F --limit-files
        -m --max-size
    "

    case "$prev" in
        --extcol)
            COMPREPLY=( $(compgen -W "cpp python php nodejs web java go rust dotnet ruby shell config" -- "$cur") )
            return 0
            ;;
    esac

    if [[ "$cur" == -* ]]; then
        COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
        return 0
    fi

    COMPREPLY=( $(compgen -f -- "$cur") )
}

complete -F _catall_completions catall
