Skip to content

Commit

Permalink
Issue #690: change --hidden-load to --hidden-loaded; change Lmod to u…
Browse files Browse the repository at this point in the history
…se hidden_loaded instead of hidden_load
  • Loading branch information
Robert McLay committed Sep 14, 2024
1 parent a8bf483 commit b979691
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions rt/modulerc/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ _ModuleTable_ = {
fullName = "ABC/2.5",
loadOrder = 1,
moduleKindT = {
hidden_load = true,
hidden_loaded = true,
kind = "soft",
},
propT = {},
Expand All @@ -747,7 +747,7 @@ _ModuleTable_ = {
fullName = "C/3.0",
loadOrder = 2,
moduleKindT = {
hidden_load = true,
hidden_loaded = true,
kind = "soft",
},
propT = {},
Expand All @@ -771,7 +771,7 @@ _ModuleTable_ = {
fullName = "E/3.0",
loadOrder = 4,
moduleKindT = {
hidden_load = true,
hidden_loaded = true,
kind = "soft",
},
propT = {},
Expand Down
2 changes: 1 addition & 1 deletion rt/modulerc/mfB/Core/ABC/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hide{name="ABC/0.5", kind="hard"}
hide{name="ABC/2.5", kind="soft",hidden_load=true}
hide{name="ABC/2.5", kind="soft",hidden_loaded=true}
hide{name="ABC/3.0", kind="soft"}
hide{name="ABC/4.0", kind="hidden"}
hide{name="ABC/5.0", kind="hard"}
2 changes: 1 addition & 1 deletion rt/modulerc/mfB/Core/C/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hide{name="C",kind="soft",hidden_load=true}
hide{name="C",kind="soft",hidden_loaded=true}
2 changes: 1 addition & 1 deletion rt/modulerc/mfB/Core/E/.modulerc.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hide{name="E",kind="soft",hidden_load=true}
hide{name="E",kind="soft",hidden_loaded=true}
2 changes: 1 addition & 1 deletion rt/modulerc/modulerc.tdesc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ EOF
runBase runSpiderCmd -o spiderT $MODULEPATH #60
runBase runSpiderCmd -o dbT $MODULEPATH #61
# Test hidden_load feature
# Test hidden_loaded feature
runLmod load C D E F #62
runLmod --mt #63
runLmod list #64
Expand Down
26 changes: 13 additions & 13 deletions rt/modulerc/out.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/MName.lua
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ function M.moduleKindT(self)
if (not self.__moduleKindT) then
return nil
end
local moduleKindT = self.__moduleKindT
local hidden_load = moduleKindT.hidden_load or nil
local moduleKindT = self.__moduleKindT
local hidden_loaded = moduleKindT.hidden_loaded or nil
local t = nil
if (moduleKindT.kind ~= "normal") then
t = {kind = moduleKindT.kind, hidden_load = hidden_load}
t = {kind = moduleKindT.kind, hidden_loaded = hidden_loaded}
end
return t
end
Expand Down
52 changes: 26 additions & 26 deletions src/MRC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,9 @@ local function l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden
l_check_user_groups(resultT))

if (not hide_active) then
-- isVisible, hidden_load, kind, count
-- isVisible, hidden_loaded, kind, count
dbg.fini("l_check_hidden_modifiers")
return true, false, "normal", true
return true, false, "normal", true
end
local isVisible
if (show_hidden) then
Expand All @@ -649,32 +649,32 @@ local function l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden

dbg.print{"fullName: ",fullName,", resultT.kind: ", resultT.kind, ", count: ",count,"\n"}
dbg.fini("l_check_hidden_modifiers")
return isVisible, resultT.hidden_load, resultT.kind, count
return isVisible, resultT.hidden_loaded, resultT.kind, count
end


-- modT is a table with: sn, fullName and fn
function M.isVisible(self, modT)
dbg.start{"MRC:isVisible(modT}"}
local frameStk = require("FrameStk"):singleton()
local mname = frameStk:mname()
local mt = frameStk:mt()
local mpathA = modT.mpathA or mt:modulePathA()
local fullName = modT.fullName
local fn = modT.fn
local sn = modT.sn
local show_hidden = modT.show_hidden
local isVisible = true
local visibleT = modT.visibleT or {}
local kind = "normal"
local hidden_load = false
local count = false
local my_resultT = nil
local frameStk = require("FrameStk"):singleton()
local mname = frameStk:mname()
local mt = frameStk:mt()
local mpathA = modT.mpathA or mt:modulePathA()
local fullName = modT.fullName
local fn = modT.fn
local sn = modT.sn
local show_hidden = modT.show_hidden
local isVisible = true
local visibleT = modT.visibleT or {}
local kind = "normal"
local hidden_loaded = false
local count = false
local my_resultT = nil
------------------------------------------------------------
-- resultT is nil if the modulefile is normal or
-- {kind="hidden|soft|hard"
-- before="<time>" after="<time>",
-- hidden_load = true|nil, }
-- hidden_loaded = true|nil, }
-- if hidden.


Expand All @@ -698,7 +698,7 @@ function M.isVisible(self, modT)
local resultT = l_findHiddenState(self, mpathA, sn, fullName, fn)
if (type(resultT) == "table" ) then
--dbg.printT("from hidden State resultT",resultT)
isVisible, hidden_load, kind, count = l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden)
isVisible, hidden_loaded, kind, count = l_check_hidden_modifiers(fullName, resultT, visibleT, show_hidden)
elseif (fullName:sub(1,1) == ".") then
isVisible = (visibleT.hidden == true or show_hidden)
count = show_hidden
Expand All @@ -710,18 +710,18 @@ function M.isVisible(self, modT)
count = show_hidden or (idx == nil)
end

modT.isVisible = isVisible
modT.mname = mname
modT.kind = kind
modT.mt = mt
modT.hidden_load = hidden_load
modT.isVisible = isVisible
modT.mname = mname
modT.kind = kind
modT.mt = mt
modT.hidden_loaded = hidden_loaded
hook.apply("isVisibleHook", modT)

my_resultT = { isVisible = modT.isVisible,
moduleKindT = {kind=modT.kind, hidden_load = modT.hidden_load},
moduleKindT = {kind=modT.kind, hidden_loaded = modT.hidden_loaded},
count = count }

--dbg.print{"fullName: ",fullName,", isVisible: ",isVisible,", kind: ",kind,", show_hidden: ", show_hidden,", count: ",count,", hidden_load: ",hidden_load,"\n"}
--dbg.print{"fullName: ",fullName,", isVisible: ",isVisible,", kind: ",kind,", show_hidden: ", show_hidden,", count: ",count,", hidden_loaded: ",hidden_loaded,"\n"}
--dbg.printT("my_resultT",my_resultT)
dbg.fini("MRC:isVisible")
return my_resultT
Expand Down
4 changes: 2 additions & 2 deletions src/RC2lua.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ proc parseMyArgs {args} {
set v [string trimleft $arg -]
dict set argT kind "\"$v\""
}
--hidden-load {
dict set argT hidden_load true
--hidden-loaded {
dict set argT hidden_loaded true
}
--not-group - --not-user - --group - --user {
set nextKeyA [string map {- {}} $arg]T
Expand Down
2 changes: 1 addition & 1 deletion src/cmdfuncs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function List(...)
local fullName = entry.fullName
local origName = entry.origUserName or ""
local showMe = true
if (entry.moduleKindT.hidden_load) then
if (entry.moduleKindT.hidden_loaded) then
showMe = show_hidden
have_hiddenL = not show_hidden
end
Expand Down
20 changes: 10 additions & 10 deletions src/mrc_funcs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ end


local hide_rulesT = {
action = {kind="string", choiceT = {hide = true}},
nameA = {kind="stringArray"},
userA = {kind="stringArray"},
groupA = {kind="stringArray"},
notUserA = {kind="stringArray"},
notGroupA = {kind="stringArray"},
after = {kind="string"},
before = {kind="string"},
kind = {kind="string", choiceT = {hard = true, normal = true, soft = true, hidden = true}},
hidden_load = {kind="boolean"},
action = {kind="string", choiceT = {hide = true}},
nameA = {kind="stringArray"},
userA = {kind="stringArray"},
groupA = {kind="stringArray"},
notUserA = {kind="stringArray"},
notGroupA = {kind="stringArray"},
after = {kind="string"},
before = {kind="string"},
kind = {kind="string", choiceT = {hard = true, soft = true, hidden = true}},
hidden_loaded = {kind="boolean"},
}

function hide(t)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function colorizePropA(style, mt, modT, mrc, propT, legendT, forbiddenT)
moduleName = colorize("hidden",modT.fullName)
pA[#pA+1] = H
legendT[H] = i18n(msg)
if (resultT.moduleKindT.hidden_load) then
if (resultT.moduleKindT.hidden_loaded) then
pA[#pA+1] = "HL"
legendT["HL"] = i18n("HiddenLoadM")
end
Expand Down

0 comments on commit b979691

Please sign in to comment.