#!/usr/bin/env bash
# Bash completion for sbo-create / sbc
# Install: copy to /etc/bash_completion.d/sbo-create

_sbo_create() {
    local cur cword words
    _init_completion || return

    local completions
    completions=$(python3 /usr/libexec/sbo-create/shell_completion.py \
        "$cword" "${words[@]}")

    if [[ -n "$completions" ]]; then
        mapfile -t COMPREPLY < <(compgen -W "$completions" -- "$cur")
    fi
}

complete -F _sbo_create sbo-create
complete -F _sbo_create sbc
