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

# koopa {{{1
# ==============================================================================
words=(
    '--help'
    '--version'
    'check-system'
    'header'
    'info'
    'install-dotfiles'
    'list'
    'prefix'
    'test'
    'uninstall'
    'update'
    'version'
)
complete -W "${words[*]}" koopa

# syntactic {{{1
# ==============================================================================
words=(
    '--prefix'
    '--recursive'
    '--strict'
)
complete -W "${words[*]}" kebab-case snake-case
words+=('--strict')
complete -W "${words[*]}" camel-case<commit_msg>Add support for multi-level completion in koopa<commit_after>#!/usr/bin/env bash

# koopa {{{1
# ==============================================================================

_koopa_complete() {
    local args cur prev
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    prev=${COMP_WORDS[COMP_CWORD-1]}
    if [ "$COMP_CWORD" -eq 1 ]
    then
        args=(
            '--help'
            '--version'
            'check-system'
            'get-version'
            'header'
            'info'
            'install'
            'list'
            'prefix'
            'test'
            'uninstall'
            'update'
        )
        COMPREPLY=("$(compgen -W "${args[*]}" -- "$cur")")
    elif [ "$COMP_CWORD" -eq 2 ]
    then
        case "$prev" in
            'install')
                args=(
                    'dotfiles'
                    'py-koopa'
                    'r-koopa'
                )
                COMPREPLY=("$(compgen -W "${args[*]}" -- "$cur")")
                ;;
            'get-version')
                args=(
                    'emacs'
                    'vim'
                )
                COMPREPLY=("$(compgen -W "${args[*]}" -- "$cur")")
                ;;
            *)
                ;;
        esac
    fi
    return 0
}
complete -F _koopa_complete koopa

# syntactic {{{1
# ==============================================================================

words=(
    '--prefix'
    '--recursive'
    '--strict'
)
complete -W "${words[*]}" kebab-case snake-case
words+=('--strict')
complete -W "${words[*]}" camel-case
{'fraction_non_alphanumeric': 0.2946265938069217, 'fraction_numerical': 0.0036429872495446266, 'mean_word_length': 1.74625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2190647', 'n_tokens_mistral': 689, 'n_tokens_neox': 625, 'n_words': 125}