#!/bin/bash
# Summary: List existing nodenv shims
# Usage: nodenv shims [--short]

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

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

shopt -s nullglob

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