@@ -63,12 +63,12 @@ export __flag_present=1
6363# shellcheck disable=SC2154
6464if [[ " ${arg_l} " != " ${__flag_present} " && " ${arg_L} " != " ${__flag_present} " &&
6565 " ${arg_v} " != " ${__flag_present} " && " ${arg_h} " != " ${__flag_present} " &&
66- -z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V} } } } } " ]]; then
67- help " ${__base} : Insufficient arguments. Please pass either -D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
66+ -z " ${arg_D:- ${arg_p:- ${arg_P:- ${arg_U:- ${arg_V:- ${arg_B} } } } } } " ]]; then
67+ help " ${__base} : Insufficient arguments. Please pass either -B, - D, -h, -l, -L, -p, -P, -U, -v, -V, or a longer equivalent."
6868fi
6969
70- # Suppress info and debug messages if -l, -P, -U, -V, -D, or their longer equivalent is present:
71- [[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D} } } } " ]] && suppress_info_debug_messages
70+ # Suppress info and debug messages if -B, - l, -P, -U, -V, -D, or their longer equivalent is present:
71+ [[ " ${arg_l} " == " ${__flag_present} " || ! -z " ${arg_P:- ${arg_U:- ${arg_V:- ${arg_D:- ${arg_B} } } } } " ]] && suppress_info_debug_messages
7272
7373[ -z " ${LOG_LEVEL:- } " ] && emergency " Cannot continue without LOG_LEVEL. "
7474
@@ -90,6 +90,7 @@ info "__usage: ${__usage}"
9090info " LOG_LEVEL: ${LOG_LEVEL} "
9191
9292info " -b (--branch): ${arg_b} "
93+ info " -B (--list-branches): ${arg_B} "
9394info " -c (--with-c): ${arg_c} "
9495info " -C (--with-cxx): ${arg_C} "
9596info " -d (--debug): ${arg_d} "
@@ -113,10 +114,12 @@ info "-v (--version): ${arg_v} "
113114info " -V (--print-version): ${arg_V} "
114115}
115116
116- # shellcheck source=./build-functions/set_or_print_default_version.sh
117- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_default_version.sh"
118- set_or_print_default_version " ${@ } "
119- export version_to_build=" ${arg_I:- ${default_version} } "
117+ if [[ -z " ${arg_B} " ]]; then
118+ # shellcheck source=./build-functions/set_or_print_default_version.sh
119+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_default_version.sh"
120+ set_or_print_default_version " ${@ } "
121+ export version_to_build=" ${arg_I:- ${default_version} } "
122+ fi
120123
121124# shellcheck source=./build-functions/set_or_print_downloader.sh
122125source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_downloader.sh"
@@ -128,20 +131,25 @@ set_or_print_url
128131
129132# shellcheck source=./build-functions/set_or_print_installation_path.sh
130133source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_or_print_installation_path.sh"
131- set_or_print_installation_path
134+
135+ if [[ -z " ${arg_B} " ]]; then
136+ set_or_print_installation_path
137+ fi
132138
133139# shellcheck source=./build-functions/download_if_necessary.sh
134140source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/download_if_necessary.sh"
135141download_if_necessary
136142
137- # shellcheck source=./build-functions/unpack_if_necessary.sh
138- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
139- unpack_if_necessary
140-
141- # shellcheck source=./build-functions/set_compilers.sh
142- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_compilers.sh"
143- set_compilers
144-
145- # shellcheck source=./build-functions/build_and_install.sh
146- source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/build_and_install.sh"
147- build_and_install
143+ if [[ -z " ${arg_B} " ]]; then
144+ # shellcheck source=./build-functions/unpack_if_necessary.sh
145+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/unpack_if_necessary.sh"
146+ unpack_if_necessary
147+
148+ # shellcheck source=./build-functions/set_compilers.sh
149+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/set_compilers.sh"
150+ set_compilers
151+
152+ # shellcheck source=./build-functions/build_and_install.sh
153+ source " ${OPENCOARRAYS_SRC_DIR:- } /prerequisites/build-functions/build_and_install.sh"
154+ build_and_install
155+ fi
0 commit comments