This commit is contained in:
Heavybullets8 2022-07-25 22:19:07 -06:00
parent f468cfbd82
commit 07be73ce57

View File

@ -19,7 +19,7 @@ source functions/update_apps.sh
# Parse script options # Parse script options
while getopts ":si::rb:t:uUpSRv-:" opt while getopts ":sirb:t:uUpSRv-:" opt
do do
case $opt in case $opt in
-) -)
@ -48,10 +48,10 @@ do
;; ;;
esac esac
;; ;;
# :) :)
# echo -e "Option: \"-$OPTARG\" requires an argument\n" && help echo -e "Option: \"-$OPTARG\" requires an argument\n" && help
# exit exit
# ;; ;;
b) b)
re='^[0-9]+$' re='^[0-9]+$'
number_of_backups=$OPTARG number_of_backups=$OPTARG
@ -62,8 +62,15 @@ do
rollback="true" rollback="true"
;; ;;
i) i)
ignore+=("$OPTARG") # Check next positional parameter
[[ -z "$ignore" ]] && echo "\"-i\" requires an argument" && exit eval nextopt=${!OPTIND}
# existing or starting with dash?
if [[ -n $nextopt && $nextopt != -* ]] ; then
OPTIND=$((OPTIND + 1))
ignore+=("$OPTARG")
else
echo "Option: \"-i\" requires an argument"
fi
;; ;;
t) t)
re='^[0-9]+$' re='^[0-9]+$'