From 0571ee82bff0edbd5ffac2228d4e6ac510b9008e Mon Sep 17 00:00:00 2001 From: Christian Heusel Date: Wed, 13 Mar 2024 17:38:56 +0100 Subject: [PATCH] repo-add: fix parseopts missing arg to -k/--key The current code treats -k/--key as a binary option which later makes it fail parsing the argument as then the end of arguments '--' is treated as the GPGKEY. We fix this by adding the appropriate specifier to the long and shortopt. Closes https://gitlab.archlinux.org/pacman/pacman/-/issues/105 Fixes: 4f43ce3e ("repo-add: use parseopts from libmakepkg") Signed-off-by: Christian Heusel --- scripts/repo-add.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index bdd549d2..39137f97 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -605,8 +605,8 @@ trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT 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' +OPT_SHORT="k:npqRsv" +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