From 97290b2442ac8de54ce7738671dc8f1509173446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohnic=CC=81?= Date: Tue, 2 Apr 2013 01:35:58 +0200 Subject: [PATCH] simplify iterating through arglist --- test/completions.bats | 5 +---- test/exec.bats | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/test/completions.bats b/test/completions.bats index 4b05357a..0f79654d 100644 --- a/test/completions.bats +++ b/test/completions.bats @@ -33,10 +33,7 @@ fi" # provide rbenv completions if [[ \$1 = --complete ]]; then shift 1 - while [[ \$# -gt 0 ]]; do - echo \$1 - shift 1 - done + for arg; do echo \$arg; done else exit 1 fi" diff --git a/test/exec.bats b/test/exec.bats index 7d80bcd0..f97ddfce 100644 --- a/test/exec.bats +++ b/test/exec.bats @@ -42,10 +42,9 @@ create_executable() { export RBENV_VERSION="2.0" create_executable "ruby" "#!$BASH echo \$0 - while [[ \$# -gt 0 ]]; do + for arg; do # hack to avoid bash builtin echo which can't output '-e' - printf \"%s\\n\" \"\$1\" - shift 1 + printf \"%s\\n\" \"\$arg\" done" run rbenv-exec ruby -w -e "puts 'hello world'" -- extra args