mk-sbuild: Use a more maintainable OPTS list using a bash array

This commit is contained in:
Marco Trevisan (Treviño) 2021-04-26 18:14:51 +02:00
parent 6bf3640e8f
commit e193c30695

25
mk-sbuild Executable file → Normal file
View File

@ -103,7 +103,30 @@ function usage()
if [ -z "$1" ]; then
usage
fi
OPTS=`getopt -o 'h' --long "help,debug,skip-updates,skip-security,skip-proposed,skip-eatmydata,arch:,name:,source-template:,debootstrap-mirror:,debootstrap-include:,debootstrap-exclude:,debootstrap-opts:,debootstrap-proxy:,debootstrap-no-check-gpg,debootstrap-keyring:,personality:,distro:,vg:,type:,target:" -- "$@"`
supported_options=(
help
debug
skip-updates
skip-security
skip-proposed
skip-eatmydata
arch:
name:
source-template:
debootstrap-mirror:
debootstrap-include:
debootstrap-exclude:
debootstrap-opts:
debootstrap-proxy:
debootstrap-no-check-gpg
debootstrap-keyring:
personality:
distro:
vg:
type:
target:
)
OPTS=$(getopt -o 'h' --long "$(IFS=, && echo "${supported_options[*]}")" -- "$@")
eval set -- "$OPTS"
VG=""