mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10e96bfc47 | ||
|
|
896e76c3d5 | ||
|
|
228fbf4c4f |
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$RBENV_DEBUG" ] && set -x
|
||||
|
||||
version="1.3.1"
|
||||
version="1.3.2"
|
||||
git_revision=""
|
||||
|
||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q rbenv; then
|
||||
|
||||
@@ -18,37 +18,33 @@ if [ "$1" = "--complete" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
exclude_shell=
|
||||
command_prefix="rbenv-"
|
||||
|
||||
if [ "$1" = "--sh" ]; then
|
||||
sh=1
|
||||
command_prefix="rbenv-sh-"
|
||||
shift
|
||||
elif [ "$1" = "--no-sh" ]; then
|
||||
nosh=1
|
||||
exclude_shell=1
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$(type -t readarray)" = "builtin" ]; then
|
||||
readarray -d : -t paths < <(printf "%s" "$PATH")
|
||||
else
|
||||
# bash 3.x compatibility
|
||||
IFS=: read -r -a paths <<<"$PATH" || true
|
||||
fi
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
{ for path in "${paths[@]}"; do
|
||||
for command in "${path}/rbenv-"*; do
|
||||
command="${command##*rbenv-}"
|
||||
if [ -n "$sh" ]; then
|
||||
if [ "${command:0:3}" = "sh-" ]; then
|
||||
echo "${command##sh-}"
|
||||
{
|
||||
PATH_remain="$PATH"
|
||||
# traverse PATH to find "rbenv-" prefixed commands
|
||||
while true; do
|
||||
path="${PATH_remain%%:*}"
|
||||
if [ -n "$path" ]; then
|
||||
for rbenv_command in "${path}/${command_prefix}"*; do
|
||||
rbenv_command="${rbenv_command##*rbenv-}"
|
||||
if [[ -z $exclude_shell || $rbenv_command != sh-* ]]; then
|
||||
echo "${rbenv_command##sh-}"
|
||||
fi
|
||||
elif [ -n "$nosh" ]; then
|
||||
if [ "${command:0:3}" != "sh-" ]; then
|
||||
echo "${command##sh-}"
|
||||
fi
|
||||
else
|
||||
echo "${command##sh-}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
[[ $PATH_remain == *:* ]] || break
|
||||
PATH_remain="${PATH_remain#*:}"
|
||||
done
|
||||
} | sort | uniq
|
||||
|
||||
@@ -154,25 +154,27 @@ print_usage() {
|
||||
if [ "$1" = "--complete-commands" ]; then
|
||||
command_prefix="${2:-}"
|
||||
seen=()
|
||||
if [ "$(type -t readarray)" = "builtin" ]; then
|
||||
readarray -d : -t paths < <(printf "%s" "$PATH")
|
||||
else
|
||||
# bash 3.x compatibility
|
||||
IFS=: read -r -a paths <<<"$PATH" || true
|
||||
fi
|
||||
shopt -s nullglob
|
||||
for path in "${paths[@]}"; do
|
||||
for command in "${path}/rbenv-${command_prefix}"*; do
|
||||
command_name="${command##*/}"
|
||||
command_name="${command_name#rbenv-}"
|
||||
command_name="${command_name#sh-}"
|
||||
[[ " ${seen[*]} " != *" ${command_name} "* ]] || continue
|
||||
seen+=("$command_name")
|
||||
summary=""
|
||||
eval "$(extract_initial_comment_block < "$command" | collect_documentation)"
|
||||
[ -n "$summary" ] || continue
|
||||
printf "%s:%s\n" "$command_name" "$summary"
|
||||
done
|
||||
PATH_remain="$PATH"
|
||||
# traverse PATH to find "rbenv-" prefixed commands
|
||||
while true; do
|
||||
path="${PATH_remain%%:*}"
|
||||
if [ -n "$path" ]; then
|
||||
for rbenv_command in "${path}/rbenv-"*; do
|
||||
command_name="${rbenv_command##*/}"
|
||||
command_name="${command_name#rbenv-}"
|
||||
command_name="${command_name#sh-}"
|
||||
[[ $command_name == "${command_prefix}"* ]] || continue
|
||||
[[ " ${seen[*]} " != *" ${command_name} "* ]] || continue
|
||||
seen+=("$command_name")
|
||||
summary=""
|
||||
eval "$(extract_initial_comment_block < "$rbenv_command" | collect_documentation)"
|
||||
[ -n "$summary" ] || continue
|
||||
printf "%s:%s\n" "$command_name" "$summary"
|
||||
done
|
||||
fi
|
||||
[[ $PATH_remain == *:* ]] || break
|
||||
PATH_remain="${PATH_remain#*:}"
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
4
share/man/man1/rbenv.1
generated
4
share/man/man1/rbenv.1
generated
@@ -4,10 +4,10 @@
|
||||
.\" Generator: Asciidoctor 2.0.20
|
||||
.\" Date: 2023-11-08
|
||||
.\" Manual: Rbenv Manual
|
||||
.\" Source: rbenv 1.3.1
|
||||
.\" Source: rbenv 1.3.2
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "RBENV" "1" "2023-11-08" "rbenv 1.3.1" "Rbenv Manual"
|
||||
.TH "RBENV" "1" "2023-11-08" "rbenv 1.3.2" "Rbenv Manual"
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.ss \n[.ss] 0
|
||||
|
||||
Reference in New Issue
Block a user