# Bash/ZSH completion for t2timeline

_t2timeline() {
    #compdef t2timeline
    if type compdef &> /dev/null; then
        if [[ "${words[CURRENT]}" == -* ]]; then
            _arguments --
        else
            _files
        fi
    else
        local cur prev words cword
        _init_completion || return
        if [[ "$cur" == -* ]]; then
            COMPREPLY=($(compgen -W "$(_parse_help "$T2HOME/scripts/t2timeline")" -- "$cur"))
        else
            _filedir
        fi
    fi
}

if type compdef &> /dev/null; then
    compdef _t2timeline t2timeline
else
    complete -F _t2timeline t2timeline
fi
