# neat(1) completion 
# rw@nebulousresearch.org

_neat() 
{
    local cur prev words cword opts helium_options icf_options extinction_options verbosity_options
    _init_completion || return
    COMPREPLY=()

    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    opts="-i -u -n -e -c -nelow -nemed -nehigh -telow -temed -tehigh -he -icf -v -id -rp --input --uncertainties --n-iterations --extinction-law --helium-data --ionisation-correction-scheme --verbosity --identify -cf --configuration-file"

    COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )

    case "${prev}" in
        --helium-data|-he)
            helium_options="P12 S96"
            COMPREPLY=( $( compgen -W "$helium_options" -- "$cur" ) )
            return 0
            ;;
	--ionisation-correction-scheme|-icf)
	    icf_options="DI14 KB94 PT92"
	    COMPREPLY=( $( compgen -W "$icf_options" -- "$cur" ) )
            return 0
            ;;
        --extinction-law|-e)
            extinction_options="How Fitz CCM LMC SMC"
            COMPREPLY=( $( compgen -W "$extinction_options" -- "$cur" ) )
            return 0
            ;;
        --verbosity|-v)
            verbosity_options="1 2 3"
            COMPREPLY=( $( compgen -W "$verbosity_options" -- "$cur" ) )
            return 0
            ;;
        --input|-i|--configuration-file|-cf)
            COMPREPLY=()
            _filedir
            return 0
            ;;
        -c|-nehigh|-nelow|-nemed|-n|--n-iterations|-tehigh|-telow|-temed)
            COMPREPLY=()
            return 0
            ;;
    esac

}
complete -F _neat neat 
