# bash completion for eos-update        -*- shell-script -*-

_eos_update_complete() {
    COMPREPLY=( $(compgen -W "$1" -- "$cur") )
    [[ $COMPREPLY == *= ]] && compopt -o nospace
}

_eos_update_() 
{
    local cur prev #words cword split
    _init_completion -s || return

    case "$prev" in
        --colors)           _eos_update_complete "yes no" ;;
        --cache-limit | -l) _eos_update_complete "{1..5}" ;;
        --min-free-bytes)   _eos_update_complete "{1..9}" ;;
        --helper)           _eos_update_complete "yay paru pacman" ;;
        --edit-mirrorlist)  _eos_update_complete "arch endeavouros" ;;
        *)                  _eos_update_complete "$(eos-update --dump-options)" ;;
    esac
}
complete -F _eos_update_    eos-update
