mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
Add depends-on modulefile command
Introduce the depends-on modulefile command which defines module requirements for currently loading modulefile. This command is an alias over prereq command with all modulefile arguments treated as a Boolean AND operation: all specified modulefiles are required.
This commit is contained in:
@@ -93,6 +93,7 @@ add-property {nop nop nop nop nop
|
||||
append-path {append-path append-path-un append-path append-path append-path edit-path-wh nop }
|
||||
chdir {chdir nop reportCmd nop nop nop nop }
|
||||
conflict {conflict nop reportCmd nop nop nop nop }
|
||||
depends-on {depends-on nop reportCmd nop nop nop nop }
|
||||
extensions {nop nop nop nop nop nop nop }
|
||||
module {module module reportCmd nop nop nop nop }
|
||||
module-alias {module-alias module-alias module-alias module-alias module-alias module-alias nop }
|
||||
@@ -2452,6 +2453,16 @@ proc require-fullname {} {
|
||||
}
|
||||
}
|
||||
|
||||
proc depends-on {args} {
|
||||
if {[llength $args] == 0} {
|
||||
knerror {wrong # args: should be "depends-on modulefile ?...?"}
|
||||
}
|
||||
# call prereq over each arg independently to emulate a prereq-all
|
||||
foreach arg $args {
|
||||
prereq $arg
|
||||
}
|
||||
}
|
||||
|
||||
# ;;; Local Variables: ***
|
||||
# ;;; mode:tcl ***
|
||||
# ;;; End: ***
|
||||
|
||||
Reference in New Issue
Block a user