modulecmd: exit with err mesg if (un)use_group() is called for

hierarchical group
This commit is contained in:
2021-12-09 17:56:34 +01:00
parent a08078b1c1
commit ec147e78be
+14
View File
@@ -1488,6 +1488,12 @@ subcommand_use() {
#..............................................................
use_group() {
if (( ${GroupDepths[${arg}]} > 0 )); then
# argument is a hierarchical group in our root
std::die 3 "%s %s: %s -- %s" \
"${CMD}" "${subcommand}" \
"illegal group" \
"${arg}"
std::append_path UsedGroups "$1"
local overlay group
for overlay in "${OverlayList[@]}"; do
@@ -1684,6 +1690,14 @@ subcommand_unuse() {
#..............................................................
unuse_group() {
if (( ${GroupDepths[${arg}]} > 0 )); then
# argument is a hierarchical group in our root
std::die 3 "%s %s: %s -- %s" \
"${CMD}" "${subcommand}" \
"illegal group" \
"${arg}"
fi
local var="PMODULES_LOADED_${arg^^}"
if [[ -n "${!var}" ]]; then
std::die 3 "%s %s: %s -- %s" \