mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
pacman-key: refactor post parse opt check into a case
This is a cleaner expression of the same information. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
768d3589a3
commit
98073afe55
@ -350,18 +350,17 @@ GPG_PACMAN="gpg --homedir ${PACMAN_KEYRING_DIR} --no-permission-warning"
|
|||||||
# check only a single operation has been given
|
# check only a single operation has been given
|
||||||
numopt=$(( ADD + DELETE + EDITKEY + EXPORT + FINGER + INIT + LIST + RECEIVE + RELOAD + UPDATEDB + VERIFY ))
|
numopt=$(( ADD + DELETE + EDITKEY + EXPORT + FINGER + INIT + LIST + RECEIVE + RELOAD + UPDATEDB + VERIFY ))
|
||||||
|
|
||||||
if (( ! numopt )); then
|
case $numopt in
|
||||||
error "$(gettext "No operations specified")"
|
0)
|
||||||
echo
|
error "$(gettext "no operation specified (use -h for help)")"
|
||||||
usage
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
;;
|
||||||
|
[!1])
|
||||||
if (( numopt != 1 )); then
|
|
||||||
error "$(gettext "Multiple operations specified")"
|
error "$(gettext "Multiple operations specified")"
|
||||||
printf "$(gettext "Please run %s with each operation separately\n")" "pacman-key"
|
printf "$(gettext "Please run %s with each operation separately\n")" "pacman-key"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
(( ! INIT )) && check_keyring
|
(( ! INIT )) && check_keyring
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user