#!/usr/bin/env bash
# Summary: List existing phpenv shims
# Usage: phpenv shims [--short]

set -e
[ -n "$PHPENV_DEBUG" ] && set -x

# Provide phpenv completions
if [ "$1" = "--complete" ]; then
  echo --short
  exit
fi

for command in "${PHPENV_ROOT}/shims/"*; do
  if [ "$1" = "--short" ]; then
    echo "${command##*/}"
  else
    echo "$command"
  fi
done | sort
