summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-22 17:53:06 -0400
committerDan McGee <dan@archlinux.org>2011-06-24 00:02:06 -0500
commite27a5c88514c5eb9480294374e98914ec27bf65d (patch)
treef0e523526c99017020a5cb5acd0ccff04020e43e
parentac7d17f88e200f3f1c213474e7b875ecd341753d (diff)
downloadpacman-e27a5c88514c5eb9480294374e98914ec27bf65d.tar.xz
parse-options: simplify unused-arg & parameter printing
Signed-off-by: Dave Reisner <d@falconindy.com>
-rw-r--r--scripts/library/parse_options.sh13
1 files 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