# bash completion for eccedc                                    -*- shell-script -*-
# shellcheck shell=bash
#
# GENERATED by scripts/completions/gen.py from saramibreak/EccEdc at 427dd5713718f5a4d2f500da0ce457ce1bebd8a2.
# Do not edit: change the generator, then run `scripts/completions/gen.py write`.
#
# eccedc (EccEdc, installed with DiscImageCreator) takes a sub-command and an
# exact number of arguments.

_mediapres_eccedc()
{
    # shellcheck disable=SC2034  # words is filled in by _init_completion
    local cur prev words cword
    _init_completion || return

    if ((cword == 1)); then
        mapfile -t COMPREPLY < <(compgen -W 'check fix write' -- "$cur")
        return
    fi
    local -a kinds
    case ${words[1]} in
        check) kinds=(type file) ;;
        fix) kinds=(type file int int) ;;
        write) kinds=(file int int int int int) ;;
        *) return ;;
    esac
    local n=$((cword - 2))
    ((n < ${#kinds[@]})) || return
    case ${kinds[n]} in
        type) mapfile -t COMPREPLY < <(compgen -W 'TOC Sub' -- "$cur") ;;
        file) _filedir ;;
    esac
} &&
    complete -F _mediapres_eccedc eccedc

# ex: filetype=sh
