From 4be97ffcc15c094deb5d51966e4b7d3c8b5c3d48 Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Mon, 17 Jun 2024 17:49:55 -0600 Subject: [PATCH 1/3] PR #686: Modified Options and Optiks to generate a perl pod doc format. Use pod2man when available to generate a man page for module --- Makefile.in | 32 +++++++++++++++++-------- build.rtm | 12 ++++++---- configure | 49 ++++++++++++++++++++++++++++++++++++++ configure.ac | 3 +++ messageDir/en.lua | 29 +++++++++------------- settarg/CmdLineOptions.lua | 8 +++++-- src/Options.lua | 39 +++++++++++++++++++++++------- src/lmod.in.lua | 18 ++++++++------ tools/Optiks.lua | 27 ++++++++++++++++++++- 9 files changed, 167 insertions(+), 50 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8e93e95ba..4a6e90b14 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,6 +81,7 @@ PS := @PS@ READLINK := @READLINK@ EXPR := @EXPR@ MODULES_AUTO_HANDLING := @MODULES_AUTO_HANDLING@ +PATH_TO_POD2MAN := @PATH_TO_POD2MAN@ PATH_TO_HASHSUM := @PATH_TO_HASHSUM@ PATH_TO_LUAC := @PATH_TO_LUAC@ PATH_TO_PAGER := @PATH_TO_PAGER@ @@ -106,7 +107,8 @@ INIT_KSH_FUNCS := $(MY_PACKAGE)/init/ksh_funcs FISH_TAB := $(MY_PACKAGE)/init/fish_tab_completion MESSAGEDIR := $(MY_PACKAGE)/messageDir LMOD_MF := $(MY_PACKAGE)/modulefiles/Core -MAN_PAGES := $(MY_PACKAGE)/share/man/cat1 +MAN_PAGES_CAT := $(MY_PACKAGE)/share/man/cat1 +MAN_PAGES := $(MY_PACKAGE)/share/man/man1 LMOD_MF_SOURCE := $(patsubst %, $(srcdir)/%, MF/*.version.lua) SETTARG_SOURCE := $(patsubst %, $(srcdir)/%, settarg/*.lua settarg/targ.in) DATE_cmd := $(srcdir)/proj_mgmt/DATE_cmd.sh @@ -138,10 +140,11 @@ ifeq ($(GIT_BRANCH),) endif -DIRLIST := $(DESTDIR)$(LIBEXEC) $(DESTDIR)$(TOOLS) $(DESTDIR)$(SETTARG) \ - $(DESTDIR)$(SHELLS) $(DESTDIR)$(INIT) $(DESTDIR)$(LIB) \ - $(DESTDIR)$(LMOD_MF) $(DESTDIR)$(MAN_PAGES) $(DESTDIR)$(MESSAGEDIR) \ - $(DESTDIR)$(I18N) $(DESTDIR)$(FISH_TAB) $(DESTDIR)$(INIT_KSH_FUNCS) +DIRLIST := $(DESTDIR)$(LIBEXEC) $(DESTDIR)$(TOOLS) $(DESTDIR)$(SETTARG) \ + $(DESTDIR)$(SHELLS) $(DESTDIR)$(INIT) $(DESTDIR)$(LIB) \ + $(DESTDIR)$(LMOD_MF) $(DESTDIR)$(MESSAGEDIR) $(DESTDIR)$(I18N) \ + $(DESTDIR)$(FISH_TAB) $(DESTDIR)$(MAN_PAGES) $(DESTDIR)$(MAN_PAGES_CAT) \ + $(DESTDIR)$(INIT_KSH_FUNCS) STANDALONE_PRGM := src/lmod.in.lua src/addto.in.lua \ src/spider.in.lua src/clearLMOD_cmd.in.lua \ @@ -252,11 +255,20 @@ echo: @echo GIT_VERSION: $(GIT_VERSION) @echo GIT_BRANCH: $(GIT_BRANCH) -man_pages: $(DESTDIR)$(MAN_PAGES) - LUA_CPATH='$(MY_PACKAGE)/lib/?.so;$(SYS_LUA_CPATH);;' \ - LUA_PATH='$(MY_PACKAGE)/libexec/?.lua;$(SYS_LUA_PATH);;' \ - $(PATH_TO_LUA) $(srcdir)/src/lmod.in.lua bash --help 2> $(DESTDIR)$(MAN_PAGES)/module.1 - chmod $(MODE_R) $(DESTDIR)$(MAN_PAGES)/module.1 +man_pages: $(DESTDIR)$(MAN_PAGES) $(DESTDIR)$(MAN_PAGES_CAT) + ifeq ($(PATH_TO_POD2MAN), UNKNOWN_POD2MAN) + LUA_CPATH='$(MY_PACKAGE)/lib/?.so;$(SYS_LUA_CPATH);;' \ + LUA_PATH='$(MY_PACKAGE)/libexec/?.lua;$(SYS_LUA_PATH);;' \ + $(PATH_TO_LUA) $(srcdir)/src/lmod.in.lua bash --help 2> $(DESTDIR)$(MAN_PAGES_CAT)/module.1 + chmod $(MODE_R) $(DESTDIR)$(MAN_PAGES_CAT)/module.1 + else + LUA_CPATH='$(MY_PACKAGE)/lib/?.so;$(SYS_LUA_CPATH);;' \ + LUA_PATH='$(MY_PACKAGE)/libexec/?.lua;$(SYS_LUA_PATH);;' \ + $(PATH_TO_LUA) $(srcdir)/src/lmod.in.lua bash --pod 2> $(DESTDIR)$(MAN_PAGES)/module.pod + $(PATH_TO_POD2MAN) $(DESTDIR)$(MAN_PAGES)/module.pod > $(DESTDIR)$(MAN_PAGES)/module.1 + $(RM) $(DESTDIR)$(MAN_PAGES)/module.pod + chmod $(MODE_R) $(DESTDIR)$(MAN_PAGES)/module.1 + endif $(DIRLIST) : install -m $(MODE_X) -d $@ diff --git a/build.rtm b/build.rtm index bc534e197..349da20da 100755 --- a/build.rtm +++ b/build.rtm @@ -5,6 +5,11 @@ echo Making Version: $PKG_VERSION parallel_make_install() { + PARALLEL_BUILD="-j" + if [ -n ${LMOD_SIMPLE_BUILD:-} ]; then + PARALLEL_BUILD="" + fi + if [ -e .git ]; then GIT_VERSION=`git describe --always` else @@ -12,12 +17,11 @@ parallel_make_install() fi if [ "$BUILD_TYPE" != "EXPERIMENTAL" ]; then - echo "$SUDO $MAKE -j GIT_VERSION=$GIT_VERSION install $MAKE_EXTRA" - $SUDO $MAKE -j GIT_VERSION=$GIT_VERSION install $MAKE_EXTRA + echo "$SUDO $MAKE $PARALLEL_BUILD GIT_VERSION=$GIT_VERSION install $MAKE_EXTRA" + $SUDO $MAKE $PARALLEL_BUILD GIT_VERSION=$GIT_VERSION install $MAKE_EXTRA else echo "$SUDO $MAKE pre-install $MAKE_EXTRA" - #$SUDO $MAKE GIT_VERSION=$GIT_VERSION -j pre-install $MAKE_EXTRA - $SUDO $MAKE GIT_VERSION=$GIT_VERSION -j pre-install $MAKE_EXTRA + $SUDO $MAKE GIT_VERSION=$GIT_VERSION $PARALLEL_BUILD pre-install $MAKE_EXTRA $SUDO rm -f $BASE_DIR/lmod/EXPERIMENTAL $SUDO ln -s $PKG_VERSION $BASE_DIR/lmod/EXPERIMENTAL fi diff --git a/configure b/configure index 01bd79321..4adc9c2ca 100755 --- a/configure +++ b/configure @@ -667,6 +667,7 @@ PATH_TO_GIT PATH_TO_LS READLINK PS +PATH_TO_POD2MAN EXPR BASENAME PATH_TO_SRC @@ -4656,6 +4657,7 @@ PATH_TO_SRC=$SRCDIR + if test $MODE != "user_default" ; then mode=0$MODE EXEC_BITS=$(( 0111 & $mode )); @@ -4955,6 +4957,53 @@ if test "$BC" = "UNKNOWN_BC" ; then exit 1 fi +# Extract the first word of "pod2man", so it can be a program name with args. +set dummy pod2man; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PATH_TO_POD2MAN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PATH_TO_POD2MAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATH_TO_POD2MAN="$PATH_TO_POD2MAN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PATH_TO_POD2MAN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PATH_TO_POD2MAN" && ac_cv_path_PATH_TO_POD2MAN="UNKNOWN_POD2MAN" + ;; +esac +fi +PATH_TO_POD2MAN=$ac_cv_path_PATH_TO_POD2MAN +if test -n "$PATH_TO_POD2MAN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PATH_TO_POD2MAN" >&5 +printf "%s\n" "$PATH_TO_POD2MAN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/configure.ac b/configure.ac index c6bb694eb..e55bf3682 100644 --- a/configure.ac +++ b/configure.ac @@ -754,6 +754,7 @@ PATH_TO_SRC=$SRCDIR AC_SUBST(BASENAME) AC_SUBST(EXPR) +AC_SUBST(PATH_TO_POD2MAN) AC_SUBST(PS) AC_SUBST(READLINK) AC_SUBST(PATH_TO_LS) @@ -821,6 +822,8 @@ if test "$BC" = "UNKNOWN_BC" ; then exit 1 fi +AC_PATH_PROG(PATH_TO_POD2MAN, pod2man, UNKNOWN_POD2MAN) + AC_PATH_PROG(PATH_TO_GIT, git, "") AC_PATH_PROGS(PATH_TO_PAGER,[less] [more], [more]) diff --git a/messageDir/en.lua b/messageDir/en.lua index 71f08767a..a4c9fb2a7 100644 --- a/messageDir/en.lua +++ b/messageDir/en.lua @@ -343,13 +343,11 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl -- Usage Message -------------------------------------------------------------------------- usage_cmdline = "module [options] sub-command [args ...]", - help_title = "Help sub-commands:\n" .. - "------------------", + help_title = "Help sub-commands:\n\n", help1 = "prints this message", help2 = "print help message from module(s)", - load_title = "Loading/Unloading sub-commands:\n" .. - "-------------------------------", + load_title = "Loading/Unloading sub-commands:\n\n", load1 = "load module(s)", load2 = "Add module(s), do not complain if not found", load3 = "Remove module(s), do not complain if not found", @@ -358,8 +356,7 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl load6 = "reload aliases from current list of modules.", load7 = "reload all currently loaded modules.", - list_title = "Listing / Searching sub-commands:\n" .. - "---------------------------------", + list_title = "Listing / Searching sub-commands:\n\n", list1 = "List loaded modules", list2 = "List loaded modules that match the pattern", list3 = "List available modules", @@ -374,15 +371,13 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl ov1 = "List all available modules by short names with number of versions", ov2 = "List available modules by short names with number of versions that contain \"string\"", - srch_title = "Searching with Lmod:\n" .. - "--------------------", + srch_title = "Searching with Lmod:\n\n", srch0 = " All searching (spider, list, avail, keyword) support regular expressions:", srch1 = "Finds all the modules that start with `p' or `P'", srch2 = "Finds all modules that have \"mpi\" in their name.", srch3 = "Finds all modules that end with \"mpi\" in their name.", - collctn_title = "Handling a collection of modules:\n".. - "--------------------------------", + collctn_title = "Handling a collection of modules:\n\n", collctn1 = "Save the current list of modules to a user defined \"default\" collection.", collctn2 = "Save the current list of modules to \"name\" collection.", collctn3 = "The same as \"restore system\"", @@ -393,15 +388,13 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl collctn8 = "Describe the contents of a module collection.", collctn9 = "Disable (i.e. remove) a collection.", - depr_title = "Deprecated commands:\n" .. - "--------------------", + depr_title = "Deprecated commands:\n\n", depr1 = "load name collection of modules or user's \"default\" if no name given.", depr2 = "===> Use \"restore\" instead <====", depr3 = "Save current list of modules to name if given, otherwise save as the default list for you the user.", depr4 = "===> Use \"save\" instead. <====", - misc_title = "Miscellaneous sub-commands:\n" .. - "---------------------------", + misc_title = "Miscellaneous sub-commands:\n\n", misc1 = "show the commands in the module file.", misc2 = "Prepend or Append path to MODULEPATH.", misc3 = "remove path from MODULEPATH.", @@ -410,8 +403,7 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl misc_isAvail = "return a true status if module can be loaded", - env_title = "Important Environment Variables:\n" .. - "--------------------------------", + env_title = "Important Environment Variables:\n\n", env1 = "If defined to be \"YES\" then Lmod prints properties and warning in color.", web_sites = "Lmod Web Sites", rpt_bug = " To report a bug please read ", @@ -447,8 +439,9 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl 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", + nx_H = "Do not print extensions", pin_hlp = "When doing a restore use specified version, do not follow defaults", + pod_H = "Generate pod format", 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)", @@ -459,7 +452,7 @@ MODULEPATH directory: "%{mpath}" has too many non-modulefiles (%{regularFn}). Pl 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", + trace_H = "trace major changes such as loads", v_hlp = "Print version info and quit", width_hlp = "Use this as max term width", diff --git a/settarg/CmdLineOptions.lua b/settarg/CmdLineOptions.lua index 5e017860d..8ec337b3b 100644 --- a/settarg/CmdLineOptions.lua +++ b/settarg/CmdLineOptions.lua @@ -65,9 +65,13 @@ function M.options(self) local Optiks = require("Optiks") local optionTbl = optionTbl() - local usage = "Usage: settarg [options] [dbg|opt|...] [anything_else]" + local usage = "settarg [options] [dbg|opt|...] [anything_else]" + local description = "Dynamically set environment variables" local versionStr = format("Lmod settarg %s",version()) - local cmdlineParser = Optiks:new{usage=usage} + local cmdlineParser = Optiks:new{usage = usage, + progName = "settarg", + descript = description, + } cmdlineParser:add_option{ name = {"-h","-?","--help"}, diff --git a/src/Options.lua b/src/Options.lua index 8270e6fb8..e156a9422 100644 --- a/src/Options.lua +++ b/src/Options.lua @@ -87,14 +87,16 @@ end -- place the positional arguments in *optionTbl.pargs* -- @param self An Option object. -- @param usage The program usage string. -function M.singleton(self, usage) +function M.singleton(self, progName, usage, description) local Optiks = require("Optiks") - local cmdlineParser = Optiks:new{usage = usage, - error = LmodWarning, - exit = l_nothing, - prt = l_prt, - envArg = os.getenv("LMOD_OPTIONS"), + local cmdlineParser = Optiks:new{usage = usage, + error = LmodWarning, + exit = l_nothing, + prt = l_prt, + progName = progName, + envArg = os.getenv("LMOD_OPTIONS"), + descript = description, } local styleA = {} @@ -160,7 +162,7 @@ function M.singleton(self, usage) cmdlineParser:add_option{ name = {"--pin_versions"}, dest = "pinVersions", - action = "store", + action = "store_true", help = i18n("pin_hlp"), } @@ -368,7 +370,14 @@ function M.singleton(self, usage) name = {"--terse_show_extensions"}, dest = "terseShowExtensions", action = "store_true", - help = i18n("terseShowExt"), + help = i18n("terseShowExt_H"), + } + + cmdlineParser:add_option{ + name = {"--pod"}, + dest = "cmdPod", + action = "store_true", + help = i18n("pod_H"), } local optTbl, pargs = cmdlineParser:parse(arg) @@ -385,6 +394,20 @@ function M.singleton(self, usage) optionTbl.cmdHelpMsg = cmdlineParser:buildHelpMsg() end + optionTbl.pod = "" + if (optionTbl.cmdPod) then + local a = {} + a[#a+1] = cmdlineParser:buildManPod() + a[#a+1] = "\n" + a[#a+1] = "=head1 COMMAND OVERVIEW\n" + a[#a+1] = Usage() + a[#a+1] = "\n" + a[#a+1] = "=head1 AUTHOR\n\n" + a[#a+1] = "Robert McLay mclay@tacc.utexas.edu" + + optionTbl.pod = concatTbl(a,"\n") + end + if (optionTbl.trace) then cosmic:assign("LMOD_TRACING", "yes") end diff --git a/src/lmod.in.lua b/src/lmod.in.lua index 3c738cf20..a809c7fac 100644 --- a/src/lmod.in.lua +++ b/src/lmod.in.lua @@ -212,7 +212,7 @@ function Usage() a[#a+1] = { i18n("env_title") } a[#a+1] = { " LMOD_COLORIZE", "", i18n("env1") } a[#a+1] = { "" } - a[#a+1] = { line} + a[#a+1] = { "" } a[#a+1] = { i18n("web_sites") } a[#a+1] = { "" } a[#a+1] = { " Documentation: https://lmod.readthedocs.org"} @@ -221,7 +221,6 @@ function Usage() a[#a+1] = { " TACC Homepage: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod"} a[#a+1] = { "" } a[#a+1] = { i18n("rpt_bug")..webBR } - a[#a+1] = { line } local twidth = TermWidth() @@ -359,8 +358,10 @@ function main() initialize_lmod() dbg.set_prefix(colorize("red","Lmod")) - local cmdLineUsage = "Usage: module [options] sub-command [args ...]" - Options:singleton(cmdLineUsage) + local cmdLineUsage = "module [options] sub-command [args ...]" + local description = "This tool allow a user to control their environment by load and unloading modulefiles. See https://lmod.readthedocs.org for more details." + + Options:singleton("module", cmdLineUsage, description) local userCmd = optionTbl.pargs[1] table.remove(optionTbl.pargs,1) @@ -478,15 +479,18 @@ function main() Shell:setActive(false) end - -- Output local vars - --Shell:expand(varTbl) - -- if Help was requested then quit. if (optionTbl.cmdHelp) then Help() os.exit(0) end + -- if pod was requested then quit. + if (optionTbl.cmdPod) then + io.stderr:write(optionTbl.pod,"\n") + os.exit(0) + end + -- Report ModuleTable if requested and exit. if (optionTbl.reportMT) then local mt = FrameStk:singleton():mt() diff --git a/tools/Optiks.lua b/tools/Optiks.lua index ba7eaf389..c876af747 100644 --- a/tools/Optiks.lua +++ b/tools/Optiks.lua @@ -96,6 +96,7 @@ function M.new(self, t) self.argNames = {} self.optA = {} + local descript = "" local envArg = nil local usage = t local version = nil @@ -104,6 +105,7 @@ function M.new(self, t) ProgName = t.progName version = t.version envArg = t.envArg + descript = t.descript Error = t.error or Error l_prt = t.prt or l_prt @@ -117,12 +119,14 @@ function M.new(self, t) ProgName = ProgName .. " " end + o.progName = ProgName o.exit = Exit o.prt = l_prt o.prtEnd = l_prtend o.usage = usage o.version = version o.envArg = envArg + o.descript = descript if (usage == nil) then local cmd = arg[0] local i,j = cmd:find(".*/") @@ -347,7 +351,7 @@ end function M.buildHelpMsg(self) local term_width = TermWidth() local b = {} - b[#b+1] = self.usage + b[#b+1] = "Usage: " .. self.usage b[#b+1] = "\n\nOptions:\n" local a = {} @@ -372,6 +376,27 @@ function M.printHelp(self) self.exit(0) end +function M.buildManPod(self) + local b = {} + b[#b+1] = self.progName + b[#b+1] = "=head1 SYNOPSIS" + b[#b+1] = self.usage + b[#b+1] = "=head1 DESCRIPTION" + b[#b+1] = self.descript + b[#b+1] = "=head1 OPTIONS" + b[#b+1] = "=over 4" + local a = {} + for _, v in ipairs(self.optA) do + local opt = v.table + a[#a+1] = "=item I<"..self.dispTbl[opt.action](self, opt)..">" + a[#a+1] = opt.help or " " + end + b[#b+1] = concatTbl(a,"\n\n") + + b[#b+1] = "=back" + return concatTbl(b,"\n\n") +end + -------------------------------------------------------------------------- -- Parse an environment variable before parsing the command line. From 5ba01ea9ffa6b6cf088969c22e8ae200bc25ac91 Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Mon, 17 Jun 2024 18:01:04 -0600 Subject: [PATCH 2/3] PR #686: updated gold files for help and i18n tests --- README.new | 4 ++++ rt/help/err.txt | 28 +++++++++++++++------------- rt/i18n/err.txt | 13 +++++++------ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/README.new b/README.new index 6b7424276..039ec9146 100644 --- a/README.new +++ b/README.new @@ -148,4 +148,8 @@ Lmod 8.7+ (8.7.39) * Fix busted test for ModuleA. (8.7.40) * Bug fix for prepend/append path when trying to add an empty string. * Bug fix for serializeTbl: handle empty or single blank string as key +W.I.P: + (8.7.41) * Issue #686: Generate a perl pod format for manpage for module.1' + + diff --git a/rt/help/err.txt b/rt/help/err.txt index 1a360da37..e2e4c4e6b 100644 --- a/rt/help/err.txt +++ b/rt/help/err.txt @@ -2,7 +2,7 @@ step 1 lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version =========================== -Modules based on Lua: Version 8.7.37 2024-03-17 13:11 -06:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu =========================== step 2 @@ -16,7 +16,7 @@ Options: -b --brief brief listing with only user specified modules -D Program tracing written to stderr --debug=dbglvl Program tracing written to stderr (where dbglvl is a number 1,2,3) - --pin_versions=pinVersions When doing a restore use specified version, do not follow defaults + --pin_versions When doing a restore use specified version, do not follow defaults -d --default List default modules only when used with avail -q --quiet Do not print out warnings --expert Expert mode @@ -42,10 +42,11 @@ Options: --no_redirect Force output of list, avail and spider to stderr --show_hidden Avail and spider will report hidden modules --spider_timeout=timeout a timeout for spider - -T --trace - --nx --no_extensions + -T --trace trace major changes such as loads + --nx --no_extensions Do not print extensions --loc --location Just print the file location when using show - --terse_show_extensions + --terse_show_extensions report extensions when doing a terse avail + --pod Generate pod format module [options] sub-command [args ...] Help sub-commands: help prints this message @@ -108,7 +109,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.37 2024-03-17 13:11 -06:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu =========================== step 3 @@ -122,7 +123,7 @@ Options: -b --brief brief listing with only user specified modules -D Program tracing written to stderr --debug=dbglvl Program tracing written to stderr (where dbglvl is a number 1,2,3) - --pin_versions=pinVersions When doing a restore use specified version, do not follow defaults + --pin_versions When doing a restore use specified version, do not follow defaults -d --default List default modules only when used with avail -q --quiet Do not print out warnings --expert Expert mode @@ -148,10 +149,11 @@ Options: --no_redirect Force output of list, avail and spider to stderr --show_hidden Avail and spider will report hidden modules --spider_timeout=timeout a timeout for spider - -T --trace - --nx --no_extensions + -T --trace trace major changes such as loads + --nx --no_extensions Do not print extensions --loc --location Just print the file location when using show - --terse_show_extensions + --terse_show_extensions report extensions when doing a terse avail + --pod Generate pod format module [options] sub-command [args ...] Help sub-commands: help prints this message @@ -214,7 +216,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.37 2024-03-17 13:11 -06:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu =========================== step 4 @@ -234,7 +236,7 @@ Version 9 step 5 lua ProjectDIR/src/lmod.in.lua shell --regression_testing --config =========================== -Modules based on Lua: Version 8.7.37 2024-03-17 13:11 -06:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu Description Value Allow root to use Lmod (LMOD_ALLOW_ROOT_USE) yes @@ -415,7 +417,7 @@ propT = { step 6 lua ProjectDIR/src/lmod.in.lua shell --regression_testing --miniConfig =========================== -Modules based on Lua: Version 8.7.37 2024-03-17 13:11 -06:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu LMOD_PACKAGE_PATH D nil LMOD_SYSTEM_DEFAULT_MODULES D __unknown__ diff --git a/rt/i18n/err.txt b/rt/i18n/err.txt index d81590aa9..7e271cfd1 100644 --- a/rt/i18n/err.txt +++ b/rt/i18n/err.txt @@ -2,7 +2,7 @@ step 1 lua ProjectDIR/src/lmod.in.lua shell --regression_testing --version =========================== -Modules based on Lua: Version 8.7.32 2023-08-28 12:42 -05:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu =========================== step 2 @@ -58,7 +58,7 @@ Options: -b --brief brief listing with only user specified modules -D Trace du programme écrite vers stderr --debug=dbglvl Trace du programme écrite vers stderr, (où dbglvl est 1, 2, 3, ...) - --pin_versions=pinVersions Lors d'une restauration, utiliser la version spécifiée, et ignorer la version par défaut + --pin_versions Lors d'une restauration, utiliser la version spécifiée, et ignorer la version par défaut -d --default Affiche seulement les modules par défaut lorsque la commande avail est utilisée -q --quiet N'affiche pas les avertissements --expert Mode expert @@ -84,10 +84,11 @@ Options: --no_redirect Affiche la sortie de list, avail, spider vers stderr --show_hidden Avail et spider afficheront les modules cachés --spider_timeout=timeout un délai maximal pour spider - -T --trace - --nx --no_extensions + -T --trace trace major changes such as loads + --nx --no_extensions Do not print extensions --loc --location Just print the file location when using show - --terse_show_extensions + --terse_show_extensions report extensions when doing a terse avail + --pod Generate pod format module [options] sub-command [args ...] Sous-commandes d'aide : help affiche ce message @@ -150,5 +151,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.32 2023-08-28 12:42 -05:00 +Modules based on Lua: Version 8.7.40 2024-06-11 15:18 -06:00 by Robert McLay mclay@tacc.utexas.edu From 7f715eeddcb11d67b882e3dc4d0b2b29bc00f620 Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Mon, 17 Jun 2024 18:04:04 -0600 Subject: [PATCH 3/3] PR #686: added --pod test and updated gold files for help and i18n tests --- rt/help/err.txt | 151 +++++++++++++++++++++++++++++++++++++++++++++ rt/help/help.tdesc | 3 +- rt/help/out.txt | 4 ++ 3 files changed, 157 insertions(+), 1 deletion(-) diff --git a/rt/help/err.txt b/rt/help/err.txt index e2e4c4e6b..d79b573a6 100644 --- a/rt/help/err.txt +++ b/rt/help/err.txt @@ -424,6 +424,157 @@ LMOD_SYSTEM_DEFAULT_MODULES D __unknown__ LMOD_USING_FAST_TCL_INTERP Other yes no =========================== step 7 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing --pod +=========================== +module +=head1 SYNOPSIS +module [options] sub-command [args ...] +=head1 DESCRIPTION +This tool allow a user to control their environment by load and unloading modulefiles. See https://lmod.readthedocs.org for more details. +=head1 OPTIONS +=over 4 +=item I<-h -? -H --help> +This help message +=item I<-s availStyle --style=availStyle> +Site controlled avail style: system (default: system) +=item I<--regression_testing> +Lmod regression testing +=item I<-b --brief> +brief listing with only user specified modules +=item I<-D> +Program tracing written to stderr +=item I<--debug=dbglvl> +Program tracing written to stderr (where dbglvl is a number 1,2,3) +=item I<--pin_versions> +When doing a restore use specified version, do not follow defaults +=item I<-d --default> +List default modules only when used with avail +=item I<-q --quiet> +Do not print out warnings +=item I<--expert> +Expert mode +=item I<-t --terse> +Write out in machine readable format for commands: list, avail, spider, savelist +=item I<--initial_load> +loading Lmod for first time in a user shell +=item I<--latest> +Load latest (ignore default) +=item I<-I --ignore_cache> +Treat the cache file(s) as out-of-date +=item I<--novice> +Turn off expert and quiet flag +=item I<--raw> +Print modulefile in raw output when used with show +=item I<-w twidth --width=twidth> +Use this as max term width +=item I<-v --version> +Print version info and quit +=item I<-r --regexp> +use regular expression match +=item I<--gitversion> +Dump git version in a machine readable way and quit +=item I<--dumpversion> +Dump version in a machine readable way and quit +=item I<--check_syntax --checkSyntax> +Checking module command syntax: do not load +=item I<--config> +Report Lmod Configuration +=item I<--miniConfig> +Report Lmod Configuration differences +=item I<--config_json> +Report Lmod Configuration in json format +=item I<--mt> +Report Module Table State +=item I<--timer> +report run times +=item I<-f --force> +force removal of a sticky module or save an empty collection +=item I<--redirect> +Send the output of list, avail, spider to stdout (not stderr) +=item I<--no_redirect> +Force output of list, avail and spider to stderr +=item I<--show_hidden> +Avail and spider will report hidden modules +=item I<--spider_timeout=timeout> +a timeout for spider +=item I<-T --trace> +trace major changes such as loads +=item I<--nx --no_extensions> +Do not print extensions +=item I<--loc --location> +Just print the file location when using show +=item I<--terse_show_extensions> +report extensions when doing a terse avail +=item I<--pod> +Generate pod format +=back +=head1 COMMAND OVERVIEW +module [options] sub-command [args ...] +Help sub-commands: + help prints this message + help module [...] print help message from module(s) +Loading/Unloading sub-commands: + load | add module [...] load module(s) + try-load | try-add module [...] Add module(s), do not complain if not found + del | unload module [...] Remove module(s), do not complain if not found + swap | sw | switch m1 m2 unload m1 and load m2 + purge unload all modules + refresh reload aliases from current list of modules. + update reload all currently loaded modules. +Listing / Searching sub-commands: + list List loaded modules + list s1 s2 ... List loaded modules that match the pattern + avail | av List available modules + avail | av string List available modules that contain "string". + category | cat List all categories + category | cat s1 s2 ... List all categories that match the pattern and display their modules + overview | ov List all available modules by short names with number of versions + overview | ov string List available modules by short names with number of versions that contain "string" + spider List all possible modules + spider module List all possible version of that module file + spider string List all module that contain the "string". + spider name/version Detailed information about that version of the module. + whatis module Print whatis information about module + keyword | key string Search all name and whatis that contain "string". +Searching with Lmod: + All searching (spider, list, avail, keyword) support regular expressions: + -r spider '^p' Finds all the modules that start with `p' or `P' + -r spider mpi Finds all modules that have "mpi" in their name. + -r spider 'mpi$ Finds all modules that end with "mpi" in their name. +Handling a collection of modules: + save | s Save the current list of modules to a user defined "default" collection. + save | s name Save the current list of modules to "name" collection. + reset The same as "restore system" + restore | r Restore modules from the user's "default" or system default. + restore | r name Restore modules from "name" collection. + restore system Restore module state to system defaults. + savelist List of saved collections. + describe | mcc name Describe the contents of a module collection. + disable name Disable (i.e. remove) a collection. +Deprecated commands: + getdefault [name] load name collection of modules or user's "default" if no name given. + ===> Use "restore" instead <==== + setdefault [name] Save current list of modules to name if given, otherwise save as the default list for you the user. + ===> Use "save" instead. <==== +Miscellaneous sub-commands: + is-loaded modulefile return a true status if module is loaded + is-avail modulefile return a true status if module can be loaded + show modulefile show the commands in the module file. + use [-a] path Prepend or Append path to MODULEPATH. + unuse path remove path from MODULEPATH. + tablelist output list of active modules as a lua table. +Important Environment Variables: + LMOD_COLORIZE If defined to be "YES" then Lmod prints properties and warning in color. +Lmod Web Sites + Documentation: https://lmod.readthedocs.org + GitHub: https://github.com/TACC/Lmod + 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 +=head1 AUTHOR +Robert McLay mclay@tacc.utexas.edu +=========================== +step 8 lua ProjectDIR/src/chkJson =========================== Json is missing key: dot_files diff --git a/rt/help/help.tdesc b/rt/help/help.tdesc index 3aa43a287..05e4372fd 100644 --- a/rt/help/help.tdesc +++ b/rt/help/help.tdesc @@ -31,8 +31,9 @@ testdescript = { runLmod help amber # 4 runLmod --config # 5 runLmod --miniConfig # 6 + runLmod --pod # 7 LD_PRELOAD= $LUA_EXEC $projectDir/src/lmod.in.lua bash --config_json 2> config.json - runBase $LUA_EXEC $projectDir/src/chkJson < config.json # 7 + runBase $LUA_EXEC $projectDir/src/chkJson < config.json # 8 HOME=$ORIG_HOME diff --git a/rt/help/out.txt b/rt/help/out.txt index bcd30ebd7..613c61dbc 100644 --- a/rt/help/out.txt +++ b/rt/help/out.txt @@ -34,5 +34,9 @@ lua ProjectDIR/src/lmod.in.lua shell --regression_testing --miniConfig =========================== =========================== step 7 +lua ProjectDIR/src/lmod.in.lua shell --regression_testing --pod +=========================== +=========================== +step 8 lua ProjectDIR/src/chkJson ===========================