From 119a7204dcf1bb0b04f34a68418aa871139b026f Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" Date: Mon, 11 Mar 2024 14:30:17 +0530 Subject: [PATCH] =?UTF-8?q?@eshanized=20pushed=20another=20commit=20via=20?= =?UTF-8?q?script=20=F0=9F=94=A5=F0=9F=94=A5=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/snigdhaos-updater/core-script | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/common/snigdhaos-updater/core-script b/common/snigdhaos-updater/core-script index 47fc7de0..84f658a4 100644 --- a/common/snigdhaos-updater/core-script +++ b/common/snigdhaos-updater/core-script @@ -133,4 +133,37 @@ fi PARAMETERS=("$@") PARSED_OPTIONS=$(getopt --options="a" --longoptions="aur,skip-mirrorlist,noconfirm" --name "$0" -- "${PARAMETERS[@]}") +if [[ $? -ne 0 ]]; then + echo -e "\033[0;31m\nFailed to parse CLI options\n\033[0m" +fi +eval set -- "$PARSED_OPTIONS" +while true; do + case "$1" in + -a | --aur) + UPDATE_AUR=1 + shift + ;; + --skip-mirrorlist) + SKIP_MIRRORLIST=1 + shift + ;; + --noconfirm) + PACMAN_NOCONFIRM=1 + shift + ;; + --) + shift + + if [ "$SNIGDHAOS_UPDATE_SELFUPDATE" == 1 ] && [ "$#" -eq 1 ] && [ -z "$1" ]; then + break + fi + PACMAN_EXTRA_OPTS+=("${@}") + break + ;; + *) + echo "Programming error" + exit 3 + ;; + esac +done