1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 06:13:53 -05:00

search commands from python version stack.

users can use multiple python versions at once.
This commit is contained in:
Yamashita Yuu
2012-08-31 16:09:46 +09:00
parent 880ea61dd8
commit 8187bc84e3
11 changed files with 113 additions and 78 deletions

View File

@@ -7,16 +7,20 @@ VERSION_FILE="$1"
if [ -e "$VERSION_FILE" ]; then
# Read and print the first non-whitespace word from the specified
# version file.
version=""
versions=()
while read -a words; do
word="${words[0]}"
if [ -z "$version" ] && [ -n "$word" ]; then
version="$word"
if [ -n "$word" ]; then
length="${#versions[@]}"
versions=("${versions[@]}" "$word")
fi
done < <( cat "$VERSION_FILE" && echo )
if [ -n "$version" ]; then
echo "$version"
if [ -n "$versions" ]; then
{
IFS=:
echo "${versions[*]}"
}
exit
fi
fi