aboutsummaryrefslogtreecommitdiff
path: root/completions/recit.zsh
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2022-07-14 03:40:24 +0000
committerJulio Capote <jcapote@gmail.com>2022-07-14 03:40:24 +0000
commit891f946e86f8a0911f67983d52fccacc9f8ebbad (patch)
tree36b032deb891f4adf5c047b255eb0ca6da275fef /completions/recit.zsh
downloadrecit-891f946e86f8a0911f67983d52fccacc9f8ebbad.tar.gz
initial
Diffstat (limited to 'completions/recit.zsh')
-rw-r--r--completions/recit.zsh19
1 files changed, 19 insertions, 0 deletions
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}")
+}