mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
simplify iterating through arglist
This commit is contained in:
parent
b8504ed2a9
commit
97290b2442
2 changed files with 3 additions and 7 deletions
|
@ -33,10 +33,7 @@ fi"
|
||||||
# provide rbenv completions
|
# provide rbenv completions
|
||||||
if [[ \$1 = --complete ]]; then
|
if [[ \$1 = --complete ]]; then
|
||||||
shift 1
|
shift 1
|
||||||
while [[ \$# -gt 0 ]]; do
|
for arg; do echo \$arg; done
|
||||||
echo \$1
|
|
||||||
shift 1
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi"
|
fi"
|
||||||
|
|
|
@ -42,10 +42,9 @@ create_executable() {
|
||||||
export RBENV_VERSION="2.0"
|
export RBENV_VERSION="2.0"
|
||||||
create_executable "ruby" "#!$BASH
|
create_executable "ruby" "#!$BASH
|
||||||
echo \$0
|
echo \$0
|
||||||
while [[ \$# -gt 0 ]]; do
|
for arg; do
|
||||||
# hack to avoid bash builtin echo which can't output '-e'
|
# hack to avoid bash builtin echo which can't output '-e'
|
||||||
printf \"%s\\n\" \"\$1\"
|
printf \"%s\\n\" \"\$arg\"
|
||||||
shift 1
|
|
||||||
done"
|
done"
|
||||||
|
|
||||||
run rbenv-exec ruby -w -e "puts 'hello world'" -- extra args
|
run rbenv-exec ruby -w -e "puts 'hello world'" -- extra args
|
||||||
|
|
Loading…
Reference in a new issue