mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 10:03:08 +02:00
modulecmd: exit with err mesg if (un)use_group() is called for
hierarchical group
This commit is contained in:
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user