aboutsummaryrefslogtreecommitdiff
path: root/completions/recit.bash
blob: 76ab736788767c5f400697b3158ad99723acf1f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
_recit() {
  COMPREPLY=()
  local word="${COMP_WORDS[COMP_CWORD]}"

  if [ "$COMP_CWORD" -eq 1 ]; then
    COMPREPLY=( $(compgen -W "$(recit commands)" -- "$word") )
  else
    local command="${COMP_WORDS[1]}"
    local completions="$(recit completions "$command")"
    COMPREPLY=( $(compgen -W "$completions" -- "$word") )
  fi
}

complete -F _recit recit