<commit_before>#!/usr/bin/env bash

_git_elegant() {
    COMPREPLY=()
    local cursor="${COMP_WORDS[COMP_CWORD]}"
    local geops="--help --version --no-workflows"
    local gecops="--help --no-workflows"
    local offset=0
    if [[ ${COMP_WORDS[*]} =~ (--no-workflows)|(-nw) ]]; then
        geops=""
        gecops=""
        if [[ ${COMP_WORDS[COMP_CWORD-1]} =~ (--no-workflows)|(-nw) ]]; then
            offset=1
        fi
    fi
    # the first word prior to the ${cursor}
    if [[ ${#COMP_WORDS[*]} > $(( 1 + ${offset} )) ]]; then
        case "${COMP_WORDS[COMP_CWORD-$(( 1 + ${offset} ))]}" in
            elegant|git-elegant)
                local opts=(
                    ${geops}
                    $(git elegant show-commands)
                )
                COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cursor}) )
                return 0 ;;
            accept-work|obtain-work)<commit_msg>Remove unsupported `-nw` option from Bash completion<commit_after>#!/usr/bin/env bash

_git_elegant() {
    COMPREPLY=()
    local cursor="${COMP_WORDS[COMP_CWORD]}"
    local geops="--help --version --no-workflows"
    local gecops="--help --no-workflows"
    local offset=0
    if [[ ${COMP_WORDS[*]} =~ --no-workflows ]]; then
        geops=""
        gecops=""
        if [[ ${COMP_WORDS[COMP_CWORD-1]} =~ --no-workflows ]]; then
            offset=1
        fi
    fi
    # the first word prior to the ${cursor}
    if [[ ${#COMP_WORDS[*]} > $(( 1 + ${offset} )) ]]; then
        case "${COMP_WORDS[COMP_CWORD-$(( 1 + ${offset} ))]}" in
            elegant|git-elegant)
                local opts=(
                    ${geops}
                    $(git elegant show-commands)
                )
                COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cursor}) )
                return 0 ;;
            accept-work|obtain-work)
{'fraction_non_alphanumeric': 0.183739837398374, 'fraction_numerical': 0.0065040650406504065, 'mean_word_length': 1.7885196374622356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4525699', 'n_tokens_mistral': 635, 'n_tokens_neox': 606, 'n_words': 125}