1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58: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 done
printf " --" printf " --"
if [[ -n $unused_options ]]; then [[ $unused_options ]] && printf ' %s' "${unused_options[@]}"
for i in ${unused_options[@]}; do [[ $1 ]] && printf " '%s'" "$@"
printf ' %s' "$i"
done
fi
if [[ -n $1 ]]; then
while [[ -n $1 ]]; do
printf " '%s'" "${1}"
shift
done
fi
printf "\n" printf "\n"
return $ret return $ret