← history for iron/libexec/iron/iron-completions
5c7af362iron/libexec/iron/iron-completions14 lines⬡ raw↓ download
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/usr/bin/env bash
set -e

COMMAND="$1"
if [ -z "$COMMAND" ]; then
  echo "usage: iron completions COMMAND [arg1 arg2...]" >&2
  exit 1
fi

COMMAND_PATH="$(command -v "iron-$COMMAND")"
if grep -i "^# provide iron completions" "$COMMAND_PATH" >/dev/null; then
  shift
  exec "$COMMAND_PATH" --complete "$@"
fi