repo-add: use parseopts from libmakepkg
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
e7806a43e0
commit
4f43ce3e4a
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue