Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

43 Zeilen
812 B

  1. #!/usr/bin/env bash
  2. # Summary: List all available pyenv commands
  3. # Usage: pyenv commands [--sh|--no-sh]
  4. set -e
  5. [ -n "$PYENV_DEBUG" ] && set -x
  6. # Provide pyenv completions
  7. if [ "$1" = "--complete" ]; then
  8. echo --sh
  9. echo --no-sh
  10. exit
  11. fi
  12. if [ "$1" = "--sh" ]; then
  13. sh=1
  14. shift
  15. elif [ "$1" = "--no-sh" ]; then
  16. nosh=1
  17. shift
  18. fi
  19. IFS=: paths=($PATH)
  20. shopt -s nullglob
  21. { for path in "${paths[@]}"; do
  22. for command in "${path}/pyenv-"*; do
  23. command="${command##*pyenv-}"
  24. if [ -n "$sh" ]; then
  25. if [ "${command:0:3}" = "sh-" ]; then
  26. echo "${command##sh-}"
  27. fi
  28. elif [ -n "$nosh" ]; then
  29. if [ "${command:0:3}" != "sh-" ]; then
  30. echo "${command##sh-}"
  31. fi
  32. else
  33. echo "${command##sh-}"
  34. fi
  35. done
  36. done
  37. } | sort | uniq