summaryrefslogtreecommitdiff
path: root/setup-apkrepos.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-21 13:04:12 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-21 13:04:12 +0100
commit3e506474a816e0c30b8cf0f30afb0f7f5059d881 (patch)
tree31a526c3b3c7a5171dcf46be2fb1822726a658e7 /setup-apkrepos.in
parenta105b5a13eb56f94bfad0eb28f2e73eafd98b671 (diff)
downloadalpine-conf-3e506474a816e0c30b8cf0f30afb0f7f5059d881.zip
setup-apkrepos: make fastest/first/random options exclusive
Makes no sense to combine them
Diffstat (limited to 'setup-apkrepos.in')
-rw-r--r--setup-apkrepos.in20
1 files changed, 16 insertions, 4 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index 5c6d49b..63b1600 100644
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -142,7 +142,7 @@ edit_repositories() {
usage() {
cat <<-__EOF__
- usage: setup-apkrepos [-cfhr1] [REPO...]
+ usage: setup-apkrepos [-ch] [-f|-r|-1|REPO...]
Setup apk repositories
@@ -163,10 +163,22 @@ add_random=false
while getopts "c1fhr" opt; do
case $opt in
c) community_prefix="";;
- f) add_fastest=true;;
- 1) add_first=true;;
+ f) add_fastest=true
+ if $add_first || $add_random; then
+ usage "1" >&2
+ fi
+ ;;
+ 1) add_first=true
+ if $add_fastest || $add_random; then
+ usage "1" >&2
+ fi
+ ;;
h) usage 0;;
- r) add_random=true;;
+ r) add_random=true
+ if $add_first || $add_fastest; then
+ usage "1" >&2
+ fi
+ ;;
'?') usage "1" >&2;;
esac
done