From e27a5c88514c5eb9480294374e98914ec27bf65d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 22 Jun 2011 17:53:06 -0400 Subject: parse-options: simplify unused-arg & parameter printing Signed-off-by: Dave Reisner --- scripts/library/parse_options.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/library/parse_options.sh b/scripts/library/parse_options.sh index 8057c288..5ced2606 100644 --- a/scripts/library/parse_options.sh +++ b/scripts/library/parse_options.sh @@ -70,17 +70,8 @@ parse_options() { done printf " --" - if [[ -n $unused_options ]]; then - for i in ${unused_options[@]}; do - printf ' %s' "$i" - done - fi - if [[ -n $1 ]]; then - while [[ -n $1 ]]; do - printf " '%s'" "${1}" - shift - done - fi + [[ $unused_options ]] && printf ' %s' "${unused_options[@]}" + [[ $1 ]] && printf " '%s'" "$@" printf "\n" return $ret -- cgit v1.2.3-70-g09d2