# bash completion for check_ipxe_menu                        -*- shell-script -*-

_check_ipxe_menu()
{
    local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
    # --option=value: bash splits at the =
    if [[ $cur == = ]]; then
        cur=
    elif [[ $prev == = && $COMP_CWORD -ge 2 ]]; then
        prev=${COMP_WORDS[COMP_CWORD-2]}
    fi
    COMPREPLY=()

    case $prev in
        -u | --url | -t | --timeout | -D | --define | --dir-file | --also)
            return
            ;;
    esac

    local options='-h --help -V --version -u --url -t --timeout -k --insecure
        -D --define --follow --dir-file --also -v --verbose'
    mapfile -t COMPREPLY < <(compgen -W "$options" -- "$cur")
}
complete -F _check_ipxe_menu check_ipxe_menu
