#!/bin/bash
# Generated like so:  s/tyd --completion
# Use like so:
#   alias tyd='s/tyd'
#   source s/_tyd-completion-bash.sh

### tyd completion - begin. generated by omelette.js ###
if type compdef &>/dev/null; then
  _tyd_completion() {
    compadd -- `tyd --compzsh --compgen "${CURRENT}" "${words[CURRENT-1]}" "${BUFFER}"`
  }
  compdef _tyd_completion tyd
elif type complete &>/dev/null; then
  _tyd_completion() {
    local cur prev nb_colon
    _get_comp_words_by_ref -n : cur prev
    nb_colon=$(grep -o ":" <<< "$COMP_LINE" | wc -l)

    COMPREPLY=( $(compgen -W '$(tyd --compbash --compgen "$((COMP_CWORD - (nb_colon * 2)))" "$prev" "${COMP_LINE}")' -- "$cur") )

    __ltrim_colon_completions "$cur"
  }
  complete -F _tyd_completion tyd
fi
### tyd completion - end ###

