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:
parent
ac7d17f88e
commit
e27a5c8851
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user