Skip to content

Commit

Permalink
Issue #667: Starting work on allowing extensions to be displayed by m…
Browse files Browse the repository at this point in the history
…l -t av
  • Loading branch information
Robert McLay committed Nov 2, 2023
1 parent ca610e6 commit 2f5bee8
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 56 deletions.
93 changes: 47 additions & 46 deletions messageDir/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -409,52 +409,53 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl
--------------------------------------------------------------------------
-- module help strings
--------------------------------------------------------------------------
StickyM = "Module is Sticky, requires --force to unload or purge",
LoadedM = "Module is loaded",
ExplM = "Experimental",
TstM = "Testing",
ObsM = "Obsolete",

help_hlp = "This help message",
style_hlp = "Site controlled avail style: %{styleA} (default: %{default})",
rt_hlp = "Lmod regression testing",
dbg_hlp = "Program tracing written to stderr",
dbg_hlp2 = "Program tracing written to stderr (where dbglvl is a number 1,2,3)",
pin_hlp = "When doing a restore use specified version, do not follow defaults",
avail_hlp = "List default modules only when used with avail",
quiet_hlp = "Do not print out warnings",
exprt_hlp = "Expert mode",
terse_hlp = "Write out in machine readable format for commands: list, avail, spider, savelist",
initL_hlp = "loading Lmod for first time in a user shell",
location_H = "Just print the file location when using show ",
latest_H = "Load latest (ignore default)",
cache_hlp = "Treat the cache file(s) as out-of-date",
novice_H = "Turn off expert and quiet flag",
raw_hlp = "Print modulefile in raw output when used with show",
width_hlp = "Use this as max term width",
v_hlp = "Print version info and quit",
rexp_hlp = "use regular expression match",
gitV_hlp = "Dump git version in a machine readable way and quit",
dumpV_hlp = "Dump version in a machine readable way and quit",
chkSyn_H = "Checking module command syntax: do not load",
config_H = "Report Lmod Configuration",
miniConfig_H = "Report Lmod Configuration differences",
jcnfig_H = "Report Lmod Configuration in json format",
MT_hlp = "Report Module Table State",
timer_hlp = "report run times",
force_hlp = "force removal of a sticky module or save an empty collection",
redirect_H= "Send the output of list, avail, spider to stdout (not stderr)",
nrdirect_H= "Force output of list, avail and spider to stderr",
hidden_H = "Avail and spider will report hidden modules",
spdrT_H = "a timeout for spider",
trace_T = "trace major changes such as loads",
nx_T = "Do not print extensions",

Where = "\n Where:\n",
Inactive = "\nInactive Modules",
DefaultM = "Default Module",
HiddenM = "Hidden Module",
Extension = "Extension that is provided by another module",
StickyM = "Module is Sticky, requires --force to unload or purge",
LoadedM = "Module is loaded",
ExplM = "Experimental",
TstM = "Testing",
ObsM = "Obsolete",

MT_hlp = "Report Module Table State",
avail_hlp = "List default modules only when used with avail",
cache_hlp = "Treat the cache file(s) as out-of-date",
chkSyn_H = "Checking module command syntax: do not load",
config_H = "Report Lmod Configuration",
dbg_hlp = "Program tracing written to stderr",
dbg_hlp2 = "Program tracing written to stderr (where dbglvl is a number 1,2,3)",
dumpV_hlp = "Dump version in a machine readable way and quit",
exprt_hlp = "Expert mode",
force_hlp = "force removal of a sticky module or save an empty collection",
gitV_hlp = "Dump git version in a machine readable way and quit",
help_hlp = "This help message",
hidden_H = "Avail and spider will report hidden modules",
initL_hlp = "loading Lmod for first time in a user shell",
jcnfig_H = "Report Lmod Configuration in json format",
latest_H = "Load latest (ignore default)",
location_H = "Just print the file location when using show ",
miniConfig_H = "Report Lmod Configuration differences",
novice_H = "Turn off expert and quiet flag",
nrdirect_H = "Force output of list, avail and spider to stderr",
nx_T = "Do not print extensions",
pin_hlp = "When doing a restore use specified version, do not follow defaults",
quiet_hlp = "Do not print out warnings",
raw_hlp = "Print modulefile in raw output when used with show",
redirect_H = "Send the output of list, avail, spider to stdout (not stderr)",
rexp_hlp = "use regular expression match",
rt_hlp = "Lmod regression testing",
spdrT_H = "a timeout for spider",
style_hlp = "Site controlled avail style: %{styleA} (default: %{default})",
terse_hlp = "Write out in machine readable format for commands: list, avail, spider, savelist",
terseShowExt_H = "report extensions when doing a terse avail",
timer_hlp = "report run times",
trace_T = "trace major changes such as loads",
v_hlp = "Print version info and quit",
width_hlp = "Use this as max term width",

Where = "\n Where:\n",
Inactive = "\nInactive Modules",
DefaultM = "Default Module",
HiddenM = "Hidden Module",
Extension = "Extension that is provided by another module",

avail = [==[If the avail list is too long consider trying:
Expand Down
12 changes: 7 additions & 5 deletions rt/help/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -45,6 +45,7 @@ Options:
-T --trace
--nx --no_extensions
--loc --location Just print the file location when using show
--terse_show_extensions
module [options] sub-command [args ...]
Help sub-commands:
help prints this message
Expand Down Expand Up @@ -107,7 +108,7 @@ Lmod Web Sites
SourceForge: https://lmod.sf.net
TACC Homepage: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
To report a bug please read https://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
===========================
step 3
Expand Down Expand Up @@ -150,6 +151,7 @@ Options:
-T --trace
--nx --no_extensions
--loc --location Just print the file location when using show
--terse_show_extensions
module [options] sub-command [args ...]
Help sub-commands:
help prints this message
Expand Down Expand Up @@ -212,7 +214,7 @@ Lmod Web Sites
SourceForge: https://lmod.sf.net
TACC Homepage: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
To report a bug please read https://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
===========================
step 4
Expand All @@ -232,7 +234,7 @@ Version 9
step 5
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --config
===========================
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
Description Value
Allow root to use Lmod (LMOD_ALLOW_ROOT_USE) yes
Expand Down Expand Up @@ -410,7 +412,7 @@ propT = {
step 6
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --miniConfig
===========================
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
LMOD_PACKAGE_PATH D nil <empty>
LMOD_SYSTEM_DEFAULT_MODULES D __unknown__ <empty>
Expand Down
5 changes: 3 additions & 2 deletions rt/i18n/err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
step 1
lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version
===========================
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
===========================
step 2
Expand Down Expand Up @@ -87,6 +87,7 @@ Options:
-T --trace
--nx --no_extensions
--loc --location Just print the file location when using show
--terse_show_extensions
module [options] sub-command [args ...]
Sous-commandes d'aide :
help affiche ce message
Expand Down Expand Up @@ -149,5 +150,5 @@ Sites web de Lmod
SourceForge: https://lmod.sf.net
TACC Homepage: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
Pour rapporter un bogue, veuillez lire https://lmod.readthedocs.io/en/latest/075_bug_reporting.html
Modules based on Lua: Version 8.7.26 2023-06-07 18:16 -05:00
Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00
by Robert McLay [email protected]
25 changes: 22 additions & 3 deletions src/Hub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,8 @@ function M.overview(self,argA)
end

availA = regroup_avail_blocks(availStyle, availA)
self:terse_avail(mpathA, availA, alias2modT, searchA, showSN, defaultOnly, defaultT, aa)
local providedByT = false
self:terse_avail(mpathA, availA, alias2modT, searchA, showSN, defaultOnly, defaultT, providedByT, aa)

local label = ""
local a = {}
Expand Down Expand Up @@ -1056,7 +1057,7 @@ function M.overview(self,argA)
return a
end

function M.terse_avail(self, mpathA, availA, alias2modT, searchA, showSN, defaultOnly, defaultT, a)
function M.terse_avail(self, mpathA, availA, alias2modT, searchA, showSN, defaultOnly, defaultT, providedByT, a)
dbg.start{"Hub:terse_avail()"}
local mrc = MRC:singleton()
local optionTbl = optionTbl()
Expand Down Expand Up @@ -1110,6 +1111,14 @@ function M.terse_avail(self, mpathA, availA, alias2modT, searchA, showSN, defaul
end
end

-- if providedByT is not false then output

if (providedByT and next(providedByT) ~= nil ) then
end




dbg.fini("Hub:terse_avail")
return a
end
Expand Down Expand Up @@ -1180,7 +1189,17 @@ function M.avail(self, argA)
if (optionTbl.terse) then
--------------------------------------------------
-- Terse output
self:terse_avail(mpathA, availA, alias2modT, searchA, showSN, defaultOnly, defaultT, a)
local spiderT = false
local dbT = false
local mpathMapT = false
local providedByT = false
if (optionTbl.terseShowExtensions) then
local cache = Cache:singleton{buildCache=true}
spiderT,dbT, mpathMapT, providedByT = cache:build()
end

self:terse_avail(mpathA, availA, alias2modT, searchA, showSN,
defaultOnly, defaultT, providedByT, a)

dbg.fini("Hub:avail")
return a
Expand Down
7 changes: 7 additions & 0 deletions src/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,13 @@ function M.singleton(self, usage)
default = 0.0
}

cmdlineParser:add_option{
name = {"--terse_show_extensions"},
dest = "terseShowExtensions",
action = "store_true",
help = i18n("terseShowExt"),
}

local optTbl, pargs = cmdlineParser:parse(arg)
local optionTbl = optionTbl()
optionTbl.pargs = pargs
Expand Down

0 comments on commit 2f5bee8

Please sign in to comment.