Skip to content

Commit ec54cb8

Browse files
committed
Add "provide" modulefile command
Add "provide" modulefile command that defines module aliases provided by currently evaluating module. "extensions" modulefile command is now an alias of "provide" command. Fixes #539 Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent 20544ba commit ec54cb8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tcl/interp.tcl.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ proc initModfileModeAliases {mode auto aliasesVN aliasesPassArgVN\
100100
# the evaluation mode
101101
set ::g_modfileEvalModes {load unload display help test whatis refresh\
102102
scan}
103-
##nagelfar ignore #48 Too long line
103+
##nagelfar ignore #49 Too long line
104104
array set g_modfilePerModeAliases {
105105
add-property {add-property nop reportCmd nop nop nop nop nop}
106106
always-load {always-load nop reportCmd nop nop nop nop always-load-sc}
@@ -110,7 +110,7 @@ complete {complete complete-un reportCmd nop nop
110110
conflict {conflict nop reportCmd nop nop nop nop conflict-sc }
111111
depends-on {prereqAllModfileCmd nop reportCmd nop nop nop nop prereq-all-sc}
112112
depends-on-any {prereqAnyModfileCmd nop reportCmd nop nop nop nop prereq-sc }
113-
extensions {nop nop nop nop nop nop nop nop }
113+
extensions {provide nop reportCmd nop nop nop nop nop }
114114
family {family family-un reportCmd nop nop nop nop family-sc }
115115
haveDynamicMPATH {nop nop nop nop nop nop nop nop }
116116
hide-modulefile {hide-modulefile hide-modulefile hide-modulefile hide-modulefile hide-modulefile hide-modulefile nop nop }
@@ -133,6 +133,7 @@ prepend-path {prepend-path prepend-path-un prepend-path prepend-path prep
133133
prereq-all {prereqAllModfileCmd nop reportCmd nop nop nop nop prereq-all-sc}
134134
prereq-any {prereqAnyModfileCmd nop reportCmd nop nop nop nop prereq-sc }
135135
prereq {prereqAnyModfileCmd nop reportCmd nop nop nop nop prereq-sc }
136+
provide {provide nop reportCmd nop nop nop nop nop }
136137
pushenv {pushenv pushenv-un pushenv pushenv pushenv pushenv-wh nop pushenv-sc }
137138
remove-path {remove-path remove-path-un remove-path remove-path remove-path edit-path-wh nop edit-path-sc}
138139
remove-property {nop nop nop nop nop nop nop nop }

tcl/mfcmd.tcl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,6 +2372,16 @@ proc module-warn {args} {
23722372
}
23732373
}
23742374
2375+
proc provide {args} {
2376+
if {![llength $args]} {
2377+
knerror {No module specified in argument}
2378+
}
2379+
set current_mod [currentState modulename]
2380+
foreach alias $args {
2381+
setLoadedAltname $current_mod [list al $alias]
2382+
}
2383+
}
2384+
23752385
# ;;; Local Variables: ***
23762386
# ;;; mode:tcl ***
23772387
# ;;; End: ***

0 commit comments

Comments
 (0)