From 891f946e86f8a0911f67983d52fccacc9f8ebbad Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Wed, 13 Jul 2022 23:40:24 -0400 Subject: initial --- libexec/recit-completions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 libexec/recit-completions (limited to 'libexec/recit-completions') 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 -- cgit v1.2.3