aboutsummaryrefslogtreecommitdiff
path: root/completions/recit.zsh
blob: db7a0434114cfa53dc6598f9b3e096c7e97a5868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if [[ ! -o interactive ]]; then
    return
fi

compctl -K _recit recit

_recit() {
  local word words completions
  read -cA words
  word="${words[2]}"

  if [ "${#words}" -eq 2 ]; then
    completions="$(recit commands)"
  else
    completions="$(recit completions "${word}")"
  fi

  reply=("${(ps:\n:)completions}")
}