# Bash tab-completion for mtn (movie_thumbnailer)

_movie_thumbnailer()
{
    local fclist
    local cur prev words cword
    _init_completion || return

    if [ "${cur:0:2}" == "--" ] ;then
        COMPREPLY=( $( compgen -W "--shadow --transparent --cover --vtt --options --filters --filter-color-primaries --tonemap" -- "$cur" ) )
    else
        case "$prev" in 
        "-f") fclist=$(fc-list :fontformat=TrueType file | cut -d : -f1)
             COMPREPLY=( $( compgen -W "$fclist" -- "$cur" ) )
            ;;
        "-I") fclist="t o i"
             COMPREPLY=( $( compgen -W "$fclist" -- "$cur" ) )
            ;;
        "-O") _filedir -d
            ;;
        *) _filedir
            ;;
        esac
    fi
}

complete -F _movie_thumbnailer mtn
