From 891f946e86f8a0911f67983d52fccacc9f8ebbad Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Wed, 13 Jul 2022 23:40:24 -0400 Subject: initial --- completions/recit.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 completions/recit.zsh (limited to 'completions/recit.zsh') diff --git a/completions/recit.zsh b/completions/recit.zsh new file mode 100644 index 0000000..db7a043 --- /dev/null +++ b/completions/recit.zsh @@ -0,0 +1,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}") +} -- cgit v1.2.3