Insensitive case¶
Configuration¶
Introduce the
icaseoption nameWhich is made persistent through the
MODULES_ICASEenvironment variableMany people asked for separate options as applying an icase approach to a module loading context is not seen desired by everybody whereas it is in an module search context
Defined levels of enablement are:
neversearchalways
icase option will be set by default to
neverin v4 not to change existing behaviorssearchin v5 as it seems to be a general improvement for everybody
A command-line switch
--icase(short form-i) is addedWas there in Modules 3 (for search sub-command only)
When set, equals to an
alwaysicase mode
No immediate need for a
--no-icasecommand-line switchCombining configuration option and
--icasecommand-line switch seems sufficient
Specification¶
When enabled, match query string in a case insensitive manner
query soFT returns soft, SOFT, soFT, SOft, sOft and so on
In case multiple files correspond to the same icase word
like soft, soFT, SoFt, SOFT filenames
query SOFT returns SOFT (exact match is returned among possibilities)
query SoFt returns SoFt (exact match is returned among possibilities)
query SOft returns soft (highest lexicographically sorted match is returned among possibilities)
query soFt returns soft (highest lexicographically sorted match is returned among possibilities)
When icase is enabled for search context it applies to
module specification passed as argument in following context:
When icase is enabled for all context it applies to
search context like described above
module specification passed as argument in following contexts:
module alias and symbolic version resolution triggered by
module-info aliasmodule-info versiongetPathToModuleisModuleEvaluated
the gathering of all module alias and symbolic version targeting a given module
this is processed by
getAllModuleResolvedNameprocedurewhich is called by
doesLoadingModuleMatchesNamecmdModuleLoad
Note that whatis specification passed as argument to the
searchsub-command is always matched in a case insensitive manner
Corner cases¶
When looking for the best match among loaded modules to select one module to unload, lastly loaded module, or firstly loaded module depending on
unload_match_orderconfiguration, will be returnedWhen insensitive case is enabled, last or first icase match will be returned even if an exact match is present among the loaded module list
This behavior has an impact in case multiple available modules correspond to the same insensitive case string
For instance iCaSe and IcAsE modules
When
icaseis enabled on all contexts and multiple directories match same icase module namefor instance following modules exist: ICASE/1.1, icase/1.2, iCaSe/1.3 and iCaSe/1.4
a
module avail -i icasewill sort iCaSe/1.4 as the highest entryhowever a
module load -i icasecommand will load icase/1.2as icase directory matches query
and also
module load -i ICasecommand will load icase/1.2as no directory ICase exists, result is returned from highest directory: icase