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.bash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 completions/recit.bash (limited to 'completions/recit.bash') 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 -- cgit v1.2.3