repo-add: use parseopts from libmakepkg

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2022-11-29 00:40:27 +10:00
parent e7806a43e0
commit 4f43ce3e4a

View file

@ -47,6 +47,7 @@ INCLUDE_SIGS=0
# Import libmakepkg # Import libmakepkg
source "$LIBRARY"/util/compress.sh source "$LIBRARY"/util/compress.sh
source "$LIBRARY"/util/message.sh source "$LIBRARY"/util/message.sh
source "$LIBRARY"/util/parseopts.sh
# ensure we have a sane umask set # ensure we have a sane umask set
umask 0022 umask 0022
@ -601,6 +602,16 @@ done
trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR
OPT_SHORT="knpqRsv"
OPT_LONG=('include-sigs' 'key' 'new' 'nocolor' 'quiet' 'prevent-downgrade' 'remove'
'sign' 'verify')
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
exit 1 # E_INVALID_OPTION
fi
set -- "${OPTRET[@]}"
unset OPT_SHORT OPT_LONG OPTRET
declare -a args declare -a args
# parse arguments # parse arguments
while (( $# )); do while (( $# )); do