_srgn() {
    local i cur prev opts cmd
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    cmd=""
    opts=""

    for i in ${COMP_WORDS[@]}
    do
        case "${cmd},${i}" in
            ",$1")
                cmd="srgn"
                ;;
            *)
                ;;
        esac
    done

    case "${cmd}" in
        srgn)
            opts="-u -l -t -n -g -S -d -s -G -i -L -j -H -v -h -V --completions --upper --lower --titlecase --normalize --german --symbols --delete --squeeze-repeats --squeeze --glob --fail-no-files --invert --literal-string --fail-any --fail-none --join-language-scopes --line-numbers --only-matching --hidden --gitignored --sorted --stdin-override-to --threads --verbose --c --c-query --cs --csharp --csharp-query --go --go-query --hcl --hcl-query --py --python --python-query --rs --rust --rust-query --ts --typescript --typescript-query --german-prefer-original --german-naive --help --version [SCOPE] [REPLACEMENT]"
            if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                return 0
            fi
            case "${prev}" in
                --completions)
                    COMPREPLY=($(compgen -W "bash elvish fish powershell zsh" -- "${cur}"))
                    return 0
                    ;;
                --glob)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                -G)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --stdin-override-to)
                    COMPREPLY=($(compgen -W "true false" -- "${cur}"))
                    return 0
                    ;;
                --threads)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --c)
                    COMPREPLY=($(compgen -W "comments strings includes type-def enum struct variable function function-def function-decl switch if for while do union identifier declaration call-expression" -- "${cur}"))
                    return 0
                    ;;
                --c-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --csharp)
                    COMPREPLY=($(compgen -W "comments strings usings struct enum interface class method variable-declaration property constructor destructor field attribute identifier" -- "${cur}"))
                    return 0
                    ;;
                --cs)
                    COMPREPLY=($(compgen -W "comments strings usings struct enum interface class method variable-declaration property constructor destructor field attribute identifier" -- "${cur}"))
                    return 0
                    ;;
                --csharp-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --go)
                    COMPREPLY=($(compgen -W "comments strings imports type-def type-alias struct interface const var func method free-func init-func type-params defer select go switch labeled goto struct-tags" -- "${cur}"))
                    return 0
                    ;;
                --go-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --hcl)
                    COMPREPLY=($(compgen -W "variable resource data output provider terraform locals module variables resource-names resource-types data-names data-sources comments strings" -- "${cur}"))
                    return 0
                    ;;
                --hcl-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --python)
                    COMPREPLY=($(compgen -W "comments strings imports doc-strings function-names function-calls class def async-def methods class-methods static-methods with try lambda globals variable-identifiers types identifiers" -- "${cur}"))
                    return 0
                    ;;
                --py)
                    COMPREPLY=($(compgen -W "comments strings imports doc-strings function-names function-calls class def async-def methods class-methods static-methods with try lambda globals variable-identifiers types identifiers" -- "${cur}"))
                    return 0
                    ;;
                --python-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --rust)
                    COMPREPLY=($(compgen -W "comments doc-comments uses strings attribute struct priv-struct pub-struct pub-crate-struct pub-self-struct pub-super-struct enum priv-enum pub-enum pub-crate-enum pub-self-enum pub-super-enum enum-variant fn impl-fn priv-fn pub-fn pub-crate-fn pub-self-fn pub-super-fn const-fn async-fn unsafe-fn extern-fn test-fn trait impl impl-type impl-trait mod mod-tests type-def identifier type-identifier closure unsafe" -- "${cur}"))
                    return 0
                    ;;
                --rs)
                    COMPREPLY=($(compgen -W "comments doc-comments uses strings attribute struct priv-struct pub-struct pub-crate-struct pub-self-struct pub-super-struct enum priv-enum pub-enum pub-crate-enum pub-self-enum pub-super-enum enum-variant fn impl-fn priv-fn pub-fn pub-crate-fn pub-self-fn pub-super-fn const-fn async-fn unsafe-fn extern-fn test-fn trait impl impl-type impl-trait mod mod-tests type-def identifier type-identifier closure unsafe" -- "${cur}"))
                    return 0
                    ;;
                --rust-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                --typescript)
                    COMPREPLY=($(compgen -W "comments strings imports function async-function sync-function method constructor class enum interface try-catch var-decl let const var type-params type-alias namespace export" -- "${cur}"))
                    return 0
                    ;;
                --ts)
                    COMPREPLY=($(compgen -W "comments strings imports function async-function sync-function method constructor class enum interface try-catch var-decl let const var type-params type-alias namespace export" -- "${cur}"))
                    return 0
                    ;;
                --typescript-query)
                    COMPREPLY=($(compgen -f "${cur}"))
                    return 0
                    ;;
                *)
                    COMPREPLY=()
                    ;;
            esac
            COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
            return 0
            ;;
    esac
}

if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
    complete -F _srgn -o nosort -o bashdefault -o default srgn
else
    complete -F _srgn -o bashdefault -o default srgn
fi
