diff --git a/Makefile.in b/Makefile.in index f18c9c92e..2d5813ff6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,6 +38,7 @@ PREPEND_BLOCK := $(shell echo "@PREPEND_BLOCK@" | tr '[:upper:]' '[: COLORIZE := $(shell echo "@COLORIZE@" | tr '[:upper:]' '[:lower:]') SETTARG_CMD := settarg_cmd MODULEPATH_INIT := @MODULEPATH_INIT@ +LMOD_TERSE_DECORATIONS := @TERSE_DECORATIONS@ LMOD_AVAIL_EXTENSIONS := @AVAIL_EXTENSIONS@ LMOD_HIDDEN_ITALIC := @HIDDEN_ITALIC@ LMOD_OVERRIDE_LANG := @LMOD_OVERRIDE_LANG@ @@ -300,6 +301,7 @@ __installMe: -e 's|@silence_shell_debugging@|$(SILENCE_SHELL_DEBUGGING)|g' \ -e 's|@dynamic_spider_cache@|$(DYNAMIC_SPIDER_CACHE)|g' \ -e 's|@fast_tcl_interp@|$(FAST_TCL_INTERP)|g' \ + -e 's|@terse_decorations@|$(LMOD_TERSE_DECORATIONS)|g' \ -e 's|@settarg_cmd@|$(SETTARG_CMD)|g' \ -e 's|@lmod_config_dir@|$(LMOD_CONFIG_DIR)|g' \ -e 's|@lmod_downstream_conflicts@|$(LMOD_DOWNSTREAM_CONFLICTS)|g' \ diff --git a/aclocal.m4 b/aclocal.m4 index 7aee612b1..7eaf3ef8d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -79,6 +79,7 @@ echo "Use ~/.config/lmod directory only..........................." : $USE_DOT_C echo "Display Extensions w/ module avail.........................." : $AVAIL_EXTENSIONS echo "Dynamic Spider Cache support................................" : $DYNAMIC_SPIDER_CACHE echo "Module Conflicts remembered................................." : $LMOD_DOWNSTREAM_CONFLICTS +echo "Allow terse listing to be decorated........................." : $TERSE_DECORATIONS echo "Allow for extended default.(ml intel/17 #-> intel/17.0.4)..." : $EXTENDED_DEFAULT #" diff --git a/configure.ac b/configure.ac index 9f79aeee3..1c9f0645a 100644 --- a/configure.ac +++ b/configure.ac @@ -510,6 +510,20 @@ AC_ARG_WITH(cachedLoads, CACHED_LOADS="$withval" AC_DEFINE_UNQUOTED(CACHED_LOADS, "$withval"))dnl +AC_SUBST(TERSE_DECORATIONS) +AC_ARG_WITH(terseDecorations, + AS_HELP_STRING([--with-terseDecorations=ans],[Allow for terse listing to be decorated. [[yes]]]), + TERSE_DECORATIONS="$withval" + TERSE_DECORATIONS=`echo $TERSE_DECORATIONS | tr '@<:@:upper:@:>@' '@<:@:lower:@:>@'` + VALID_YN $TERSE_DECORATIONS "--with-terseDecorations=ans: ans must be yes or no" + AC_MSG_RESULT([TERSE_DECORATIONS=$with_terseDecorations]) + AC_DEFINE_UNQUOTED(TERSE_DECORATIONS, "$with_terseDecorations")dnl + , + withval="yes" + AC_MSG_RESULT([TERSE_DECORATIONS=$withval]) + TERSE_DECORATIONS="$withval" + AC_DEFINE_UNQUOTED(TERSE_DECORATIONS, "$withval"))dnl + AC_SUBST(EXTENDED_DEFAULT) AC_ARG_WITH(extendedDefault, AS_HELP_STRING([--with-extendedDefault=ans],[Allow for extended default. [[yes]]]), diff --git a/docs/source/090_configuring_lmod.rst b/docs/source/090_configuring_lmod.rst index 421a68025..e6b2fda75 100644 --- a/docs/source/090_configuring_lmod.rst +++ b/docs/source/090_configuring_lmod.rst @@ -221,6 +221,12 @@ the configuration option which will set the action. [string, default: , --with-syshost]. This variable can be used to help with module tracking. See :ref:`tracking_usage` for details. +**LMOD_TERSE_DECORATIONS**: + [yes/no, default: yes, --with-terseDecorations]. Terse listing from + **module --terse list**, **module --terse avail** and + **module --terse spider** include decorations. Set this variable to + no to prevent this output. + **LMOD_TMOD_FIND_FIRST**: [yes/no, default: no, --with-tmodFindFirst]. Normally Lmod uses the FIND BEST rule to search for defaults when searching C/N/V or N/V diff --git a/src/Configuration.lua b/src/Configuration.lua index ea803435e..1e73bba29 100644 --- a/src/Configuration.lua +++ b/src/Configuration.lua @@ -173,6 +173,7 @@ local function l_new(self) local site_prefix = cosmic:value("SITE_CONTROLLED_PREFIX") local syshost = cosmic:value("LMOD_SYSHOST") or "" local system_name = cosmic:value("LMOD_SYSTEM_NAME") or "" + local terse_decorations = cosmic:value("LMOD_TERSE_DECORATIONS") local threshold = cosmic:value("LMOD_THRESHOLD") local tmod_rule = cosmic:value("LMOD_TMOD_PATH_RULE") local tracing = cosmic:value("LMOD_TRACING") @@ -216,78 +217,79 @@ local function l_new(self) end local tbl = {} - tbl.allowRoot = { k = "Allow root to use Lmod" , v = allow_root_use, n = "LMOD_ALLOW_ROOT_USE" } - tbl.allowTCL = { k = "Allow TCL modulefiles" , v = allow_tcl_mfiles, n = "LMOD_ALLOW_TCL_FILES" } - tbl.avail_style = { k = "Avail Style" , v = avail_style, n = "LMOD_AVAIL_STYLE" } - tbl.autoSwap = { k = "Auto swapping" , v = auto_swap, n = "LMOD_AUTO_SWAP" } - tbl.case = { k = "Case Independent Sorting" , v = case_ind_sorting, n = "LMOD_CASE_INDEPENDENT_SORTING" } - tbl.colorize = { k = "Colorize Lmod" , v = lmod_colorize, n = "LMOD_COLORIZE" } - tbl.configDir = { k = "Configuration dir" , v = lmod_configDir, n = "LMOD_CONFIG_DIR" } - tbl.disable1N = { k = "Disable Same Name AutoSwap" , v = disable1N, n = "LMOD_DISABLE_SAME_NAME_AUTOSWAP" } - tbl.disp_av_ext = { k = "Display Extension w/ avail" , v = avail_extensions, n = "LMOD_AVAIL_EXTENSIONS" } - tbl.dotConfOnly = { k = "Use ~/.config dir only" , v = useDotConfigOnly, n = "LMOD_USE_DOT_CONFIG_ONLY" } - tbl.dupPaths = { k = "Allow duplicate paths" , v = duplicate_paths, n = "LMOD_DUPLICATE_PATHS" } - tbl.dynamicC = { k = "Dynamic Spider Cache" , v = dynamic_cache, n = "LMOD_DYNAMIC_SPIDER_CACHE" } - tbl.extendDflt = { k = "Allow extended default" , v = extended_default, n = "LMOD_EXTENDED_DEFAULT" } - tbl.exactMatch = { k = "Require Exact Match/no defaults" , v = exactMatch, n = "LMOD_EXACT_MATCH" } - tbl.expMCmd = { k = "Export the module command" , v = export_module, n = "LMOD_EXPORT_MODULE" } - tbl.fastTCL = { k = "Use attached TCL over system call" , v = fast_tcl_interp, n = "LMOD_FAST_TCL_INTERP" } - tbl.fastTCLUsing = { k = "Is fast TCL interp available" , v = using_fast_tcl, n = "LMOD_USING_FAST_TCL_INTERP" } - tbl.fileIgnPatt = { k = "File ignore patterns" , v = fileIgnPattStr, n = "LMOD_FILE_IGNORE_PATTERNS" } - tbl.hiddenItalic = { k = "Use italic instead of dim" , v = hiddenItalic, n = "LMOD_HIDDEN_ITALIC" } - tbl.ksh_support = { k = "KSH Support" , v = ksh_support, n = "LMOD_KSH_SUPPORT" } - tbl.lang = { k = "Language used for err/msg/warn" , v = lmod_lang, n = "LMOD_LANG" } - tbl.lang_site = { k = "Site message file" , v = site_msg_file, n = "LMOD_SITE_MSG_FILE" } - tbl.lua_cpath = { k = "LUA_CPATH" , v = "@sys_lua_cpath@",n = false } - tbl.lua_path = { k = "LUA_PATH" , v = "@sys_lua_path@", n = false } - tbl.ld_preload = { k = "LD_PRELOAD at config time" , v = ld_preload, n = "LMOD_LD_PRELOAD" } - tbl.ld_lib_path = { k = "LD_LIBRARY_PATH at config time" , v = ld_lib_path, n = "LMOD_LD_LIBRARY_PATH" } - tbl.lfsV = { k = "LuaFileSystem version" , v = lfsV, n = false } - tbl.lmod_cfg = { k = "lmod_config.lua location" , v = lmod_cfg_path, n = "LMOD_CONFIG_LOCATION" } - tbl.lmodV = { k = "Lmod version" , v = lmod_version, n = false } - tbl.lmod_branch = { k = "Lmod branch" , v = lmod_branch, n = "LMOD_BRANCH" } - tbl.luaV = { k = "Lua Version" , v = _VERSION, n = false } - tbl.lua_term = { k = "System lua-term" , v = have_term, n = "LMOD_HAVE_LUA_TERM" } - tbl.lua_term_A = { k = "Active lua-term" , v = activeTerm, n = false } - tbl.mAutoHndl = { k = "Modules Auto Handling" , v = mAutoHanding, n = "MODULES_AUTO_HANDLING" } - tbl.mpath_av = { k = "avail: Include modulepath dir" , v = mpath_avail, n = "LMOD_MPATH_AVAIL" } - tbl.mpath_init = { k = "MODULEPATH_INIT" , v = mpath_init, n = "LMOD_MODULEPATH_INIT" } - tbl.mpath_root = { k = "MODULEPATH_ROOT" , v = mpath_root, n = "MODULEPATH_ROOT" } - tbl.modRC = { k = "MODULERC" , v = rc, n = "LMOD_MODULERC" } - tbl.nag = { k = "NAG File" , v = nag, n = "LMOD_ADMIN_FILE" } - tbl.numSC = { k = "number of cache dirs" , v = numSC, n = false } - tbl.os_name = { k = "OS Name" , v = os_name, n = false } - tbl.pager = { k = "Pager" , v = pager, n = "LMOD_PAGER" } - tbl.pager_opts = { k = "Pager Options" , v = pager_opts, n = "LMOD_PAGER_OPTS" } - tbl.path_hash = { k = "Path to HashSum" , v = hashsum_path, n = "LMOD_HASHSUM_PATH" } - tbl.path_lua = { k = "Path to Lua" , v = lua_path, n = false } - tbl.dsConflicts = { k = "Downstream Module Conflicts" , v = dsConflicts, n = "LMOD_DOWNSTREAM_CONFLICTS" } - tbl.pin_v = { k = "Pin Versions in restore" , v = pin_versions, n = "LMOD_PIN_VERSIONS" } - tbl.pkg = { k = "Pkg Class name" , v = pkgName, n = false } - tbl.prefix = { k = "Lmod prefix" , v = "@PREFIX@", n = false } - tbl.prefix_site = { k = "Site controlled prefix" , v = site_prefix, n = "SITE_CONTROLLED_PREFIX" } - tbl.prpnd_blk = { k = "Prepend order" , v = prepend_block, n = "LMOD_PREPEND_BLOCK" } - tbl.rc = { k = "LMOD_RC" , v = lmodrc, n = "LMOD_RC" } - tbl.settarg = { k = "Supporting Full Settarg Use" , v = settarg_support, n = "LMOD_SETTARG_FULL_SUPPORT" } - tbl.shell = { k = "User shell" , v = myShellName(), n = false } - tbl.sitePkg = { k = "Site Pkg location" , v = locSitePkg, n = false } - tbl.siteName = { k = "Site Name" , v = site_name, n = "LMOD_SITE_NAME" } - tbl.spdr_ignore = { k = "Ignore Cache" , v = ignore_cache, n = "LMOD_IGNORE_CACHE" } - tbl.spdr_loads = { k = "Cached loads" , v = cached_loads, n = "LMOD_CACHED_LOADS" } - tbl.sysDfltM = { k = "System Default Modules" , v = dfltModules, n = "LMOD_SYSTEM_DEFAULT_MODULES" } - tbl.sysName = { k = "System Name" , v = system_name, n = "LMOD_SYSTEM_NAME" } - tbl.syshost = { k = "SYSHOST (cluster name)" , v = syshost, n = "LMOD_SYSHOST" } - tbl.tcl_version = { k = "TCL Version" , v = tcl_version, n = false } - tbl.tm_ancient = { k = "User cache valid time(sec)" , v = ancient, n = "LMOD_ANCIENT_TIME" } - tbl.tm_short = { k = "Write cache after (sec)" , v = shortTime, n = "LMOD_SHORT_TIME" } - tbl.tm_threshold = { k = "Threshold (sec)" , v = threshold, n = "LMOD_THRESHOLD" } - tbl.tmod_find1st = { k = "Tmod find first rule" , v = find_first, n = "LMOD_TMOD_PATH_RULE" } - tbl.tmod_rule = { k = "Tmod prepend PATH Rule" , v = tmod_rule, n = "LMOD_TMOD_PATH_RULE" } - tbl.tracing = { k = "Tracing" , v = tracing, n = "LMOD_TRACING" } - tbl.uname = { k = "uname -a" , v = uname, n = false } - tbl.usrCacheDir = { k = "User Cache Directory" , v = usrCacheDir, n = false } - tbl.redirect = { k = "Redirect to stdout" , v = redirect, n = "LMOD_REDIRECT" } - tbl.z01_admin = { k = "Admin file" , v = adminFn, n = false } + tbl.allowRoot = { k = "Allow root to use Lmod" , v = allow_root_use, n = "LMOD_ALLOW_ROOT_USE" } + tbl.allowTCL = { k = "Allow TCL modulefiles" , v = allow_tcl_mfiles, n = "LMOD_ALLOW_TCL_FILES" } + tbl.avail_style = { k = "Avail Style" , v = avail_style, n = "LMOD_AVAIL_STYLE" } + tbl.autoSwap = { k = "Auto swapping" , v = auto_swap, n = "LMOD_AUTO_SWAP" } + tbl.case = { k = "Case Independent Sorting" , v = case_ind_sorting, n = "LMOD_CASE_INDEPENDENT_SORTING" } + tbl.colorize = { k = "Colorize Lmod" , v = lmod_colorize, n = "LMOD_COLORIZE" } + tbl.configDir = { k = "Configuration dir" , v = lmod_configDir, n = "LMOD_CONFIG_DIR" } + tbl.disable1N = { k = "Disable Same Name AutoSwap" , v = disable1N, n = "LMOD_DISABLE_SAME_NAME_AUTOSWAP" } + tbl.disp_av_ext = { k = "Display Extension w/ avail" , v = avail_extensions, n = "LMOD_AVAIL_EXTENSIONS" } + tbl.dotConfOnly = { k = "Use ~/.config dir only" , v = useDotConfigOnly, n = "LMOD_USE_DOT_CONFIG_ONLY" } + tbl.dupPaths = { k = "Allow duplicate paths" , v = duplicate_paths, n = "LMOD_DUPLICATE_PATHS" } + tbl.dynamicC = { k = "Dynamic Spider Cache" , v = dynamic_cache, n = "LMOD_DYNAMIC_SPIDER_CACHE" } + tbl.extendDflt = { k = "Allow extended default" , v = extended_default, n = "LMOD_EXTENDED_DEFAULT" } + tbl.exactMatch = { k = "Require Exact Match/no defaults" , v = exactMatch, n = "LMOD_EXACT_MATCH" } + tbl.expMCmd = { k = "Export the module command" , v = export_module, n = "LMOD_EXPORT_MODULE" } + tbl.fastTCL = { k = "Use attached TCL over system call" , v = fast_tcl_interp, n = "LMOD_FAST_TCL_INTERP" } + tbl.fastTCLUsing = { k = "Is fast TCL interp available" , v = using_fast_tcl, n = "LMOD_USING_FAST_TCL_INTERP" } + tbl.fileIgnPatt = { k = "File ignore patterns" , v = fileIgnPattStr, n = "LMOD_FILE_IGNORE_PATTERNS" } + tbl.hiddenItalic = { k = "Use italic instead of dim" , v = hiddenItalic, n = "LMOD_HIDDEN_ITALIC" } + tbl.ksh_support = { k = "KSH Support" , v = ksh_support, n = "LMOD_KSH_SUPPORT" } + tbl.lang = { k = "Language used for err/msg/warn" , v = lmod_lang, n = "LMOD_LANG" } + tbl.lang_site = { k = "Site message file" , v = site_msg_file, n = "LMOD_SITE_MSG_FILE" } + tbl.lua_cpath = { k = "LUA_CPATH" , v = "@sys_lua_cpath@", n = false } + tbl.lua_path = { k = "LUA_PATH" , v = "@sys_lua_path@", n = false } + tbl.ld_preload = { k = "LD_PRELOAD at config time" , v = ld_preload, n = "LMOD_LD_PRELOAD" } + tbl.ld_lib_path = { k = "LD_LIBRARY_PATH at config time" , v = ld_lib_path, n = "LMOD_LD_LIBRARY_PATH" } + tbl.lfsV = { k = "LuaFileSystem version" , v = lfsV, n = false } + tbl.lmod_cfg = { k = "lmod_config.lua location" , v = lmod_cfg_path, n = "LMOD_CONFIG_LOCATION" } + tbl.lmodV = { k = "Lmod version" , v = lmod_version, n = false } + tbl.lmod_branch = { k = "Lmod branch" , v = lmod_branch, n = "LMOD_BRANCH" } + tbl.luaV = { k = "Lua Version" , v = _VERSION, n = false } + tbl.lua_term = { k = "System lua-term" , v = have_term, n = "LMOD_HAVE_LUA_TERM" } + tbl.lua_term_A = { k = "Active lua-term" , v = activeTerm, n = false } + tbl.mAutoHndl = { k = "Modules Auto Handling" , v = mAutoHanding, n = "MODULES_AUTO_HANDLING" } + tbl.mpath_av = { k = "avail: Include modulepath dir" , v = mpath_avail, n = "LMOD_MPATH_AVAIL" } + tbl.mpath_init = { k = "MODULEPATH_INIT" , v = mpath_init, n = "LMOD_MODULEPATH_INIT" } + tbl.mpath_root = { k = "MODULEPATH_ROOT" , v = mpath_root, n = "MODULEPATH_ROOT" } + tbl.modRC = { k = "MODULERC" , v = rc, n = "LMOD_MODULERC" } + tbl.nag = { k = "NAG File" , v = nag, n = "LMOD_ADMIN_FILE" } + tbl.numSC = { k = "number of cache dirs" , v = numSC, n = false } + tbl.os_name = { k = "OS Name" , v = os_name, n = false } + tbl.pager = { k = "Pager" , v = pager, n = "LMOD_PAGER" } + tbl.pager_opts = { k = "Pager Options" , v = pager_opts, n = "LMOD_PAGER_OPTS" } + tbl.path_hash = { k = "Path to HashSum" , v = hashsum_path, n = "LMOD_HASHSUM_PATH" } + tbl.path_lua = { k = "Path to Lua" , v = lua_path, n = false } + tbl.dsConflicts = { k = "Downstream Module Conflicts" , v = dsConflicts, n = "LMOD_DOWNSTREAM_CONFLICTS" } + tbl.pin_v = { k = "Pin Versions in restore" , v = pin_versions, n = "LMOD_PIN_VERSIONS" } + tbl.pkg = { k = "Pkg Class name" , v = pkgName, n = false } + tbl.prefix = { k = "Lmod prefix" , v = "@PREFIX@", n = false } + tbl.prefix_site = { k = "Site controlled prefix" , v = site_prefix, n = "SITE_CONTROLLED_PREFIX" } + tbl.prpnd_blk = { k = "Prepend order" , v = prepend_block, n = "LMOD_PREPEND_BLOCK" } + tbl.rc = { k = "LMOD_RC" , v = lmodrc, n = "LMOD_RC" } + tbl.settarg = { k = "Supporting Full Settarg Use" , v = settarg_support, n = "LMOD_SETTARG_FULL_SUPPORT" } + tbl.shell = { k = "User shell" , v = myShellName(), n = false } + tbl.sitePkg = { k = "Site Pkg location" , v = locSitePkg, n = false } + tbl.siteName = { k = "Site Name" , v = site_name, n = "LMOD_SITE_NAME" } + tbl.spdr_ignore = { k = "Ignore Cache" , v = ignore_cache, n = "LMOD_IGNORE_CACHE" } + tbl.spdr_loads = { k = "Cached loads" , v = cached_loads, n = "LMOD_CACHED_LOADS" } + tbl.sysDfltM = { k = "System Default Modules" , v = dfltModules, n = "LMOD_SYSTEM_DEFAULT_MODULES" } + tbl.sysName = { k = "System Name" , v = system_name, n = "LMOD_SYSTEM_NAME" } + tbl.syshost = { k = "SYSHOST (cluster name)" , v = syshost, n = "LMOD_SYSHOST" } + tbl.tcl_version = { k = "TCL Version" , v = tcl_version, n = false } + tbl.terse_decorate = { k = "Terse Decorations" , v = terse_decorations, n = "LMOD_TERSE_DECORATIONS" } + tbl.tm_ancient = { k = "User cache valid time(sec)" , v = ancient, n = "LMOD_ANCIENT_TIME" } + tbl.tm_short = { k = "Write cache after (sec)" , v = shortTime, n = "LMOD_SHORT_TIME" } + tbl.tm_threshold = { k = "Threshold (sec)" , v = threshold, n = "LMOD_THRESHOLD" } + tbl.tmod_find1st = { k = "Tmod find first rule" , v = find_first, n = "LMOD_TMOD_PATH_RULE" } + tbl.tmod_rule = { k = "Tmod prepend PATH Rule" , v = tmod_rule, n = "LMOD_TMOD_PATH_RULE" } + tbl.tracing = { k = "Tracing" , v = tracing, n = "LMOD_TRACING" } + tbl.uname = { k = "uname -a" , v = uname, n = false } + tbl.usrCacheDir = { k = "User Cache Directory" , v = usrCacheDir, n = false } + tbl.redirect = { k = "Redirect to stdout" , v = redirect, n = "LMOD_REDIRECT" } + tbl.z01_admin = { k = "Admin file" , v = adminFn, n = false } o.tbl = tbl return o diff --git a/src/myGlobals.lua b/src/myGlobals.lua index f80fcc1d2..6c87a2ff0 100644 --- a/src/myGlobals.lua +++ b/src/myGlobals.lua @@ -246,6 +246,13 @@ cosmic:init{name = "LMOD_CONFIG_DIR", sedV = "@lmod_config_dir@", default = "/etc/lmod"} +------------------------------------------------------------------------ +-- LMOD_TERSE_DECORATIONS: Allow terse listing to be decorated +------------------------------------------------------------------------ +cosmic:init{name = "LMOD_TERSE_DECORATIONS", + sedV = "@terse_decorations@", + default = "yes"} + ------------------------------------------------------------------------ -- LMOD_PACKAGE_PATH: Colon separated list of directories to search for -- SitePackage.lua diff --git a/src/utils.lua b/src/utils.lua index e9f951539..75c9e26a9 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -870,15 +870,26 @@ function decorateModule(name, resultT, forbiddenT) s_decoyT = { forbiddenState = "normal" } - s_decorateT = { - normal = "", - hidden = " ", - soft = " ", - forbid = " ", - nearly = " ", - } + local decorate = cosmic:value("LMOD_TERSE_DECORATIONS") + if (decorate == "yes") then + s_decorateT = { + normal = "", + hidden = " ", + soft = " ", + forbid = " ", + nearly = " ", + } + else + s_decorateT = { + normal = "", + hidden = "", + soft = "", + forbid = "", + nearly = "", + } + end end - + local fT = forbiddenT if (not forbiddenT or next(forbiddenT) == nil) then fT = s_decoyT