aboutsummaryrefslogtreecommitdiff
path: root/libexec/recit-completions
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 /libexec/recit-completions
downloadrecit-891f946e86f8a0911f67983d52fccacc9f8ebbad.tar.gz
initial
Diffstat (limited to 'libexec/recit-completions')
-rwxr-xr-xlibexec/recit-completions14
1 files changed, 14 insertions, 0 deletions
diff --git a/libexec/recit-completions b/libexec/recit-completions
new file mode 100755
index 0000000..2384dc3
--- /dev/null
+++ b/libexec/recit-completions
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+set -e
+
+COMMAND="$1"
+if [ -z "$COMMAND" ]; then
+ echo "usage: recit completions COMMAND [arg1 arg2...]" >&2
+ exit 1
+fi
+
+COMMAND_PATH="$(command -v "recit-$COMMAND")"
+if grep -i "^# provide recit completions" "$COMMAND_PATH" >/dev/null; then
+ shift
+ exec "$COMMAND_PATH" --complete "$@"
+fi