1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 07:48:50 -05:00

parse-options: simplify unused-arg & parameter printing

Signed-off-by: Dave Reisner <d@falconindy.com>
This commit is contained in:
Dave Reisner 2011-06-22 17:53:06 -04:00 committed by Dan McGee
parent ac7d17f88e
commit e27a5c8851

View File

@ -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