aboutsummaryrefslogtreecommitdiff
path: root/completions/recit.bash
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.bash
downloadrecit-891f946e86f8a0911f67983d52fccacc9f8ebbad.tar.gz
initial
Diffstat (limited to 'completions/recit.bash')
-rw-r--r--completions/recit.bash14
1 files changed, 14 insertions, 0 deletions
diff --git a/completions/recit.bash b/completions/recit.bash
new file mode 100644
index 0000000..76ab736
--- /dev/null
+++ b/completions/recit.bash
@@ -0,0 +1,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