Debian Codegraph @

doc/source/design/insensitive-case.rst

raw
1 .. _insensitive-case:
2
3 Insensitive case
4 ================
5
6 Configuration
7 -------------
8
9 - Introduce the :mconfig:`icase` option name
10
11 - Which is made persistent through the :envvar:`MODULES_ICASE` environment variable
12 - Many 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
13 - Defined levels of enablement are:
14
15 - ``never``
16 - ``search``
17 - ``always``
18
19 - icase option will be set by default to
20
21 - ``never`` in v4 not to change existing behaviors
22 - ``search`` in v5 as it seems to be a general improvement for everybody
23
24 - A command-line switch :option:`--icase` (short form :option:`-i`) is added
25
26 - Was there in Modules 3 (for search sub-command only)
27 - When set, equals to an ``always`` icase mode
28
29 - No immediate need for a ``--no-icase`` command-line switch
30
31 - Combining configuration option and ``--icase`` command-line switch seems sufficient
32
33 Specification
34 -------------
35
36 - When enabled, match query string in a case insensitive manner
37
38 - query *soFT* returns soft, SOFT, soFT, SOft, sOft and so on
39
40 - In case multiple files correspond to the same icase word
41
42 - like *soft*, *soFT*, *SoFt*, *SOFT* filenames
43 - query *SOFT* returns *SOFT* (exact match is returned among possibilities)
44 - query *SoFt* returns *SoFt* (exact match is returned among possibilities)
45 - query *SOft* returns *soft* (highest lexicographically sorted match is returned among possibilities)
46 - query *soFt* returns *soft* (highest lexicographically sorted match is returned among possibilities)
47
48 - When icase is enabled for search context it applies to
49
50 - module specification passed as argument in following context:
51
52 - :ref:`module_version_specification_to_return_all_matching_modules`
53
54 - When icase is enabled for all context it applies to
55
56 - search context like described above
57 - module specification passed as argument in following contexts:
58
59 - :ref:`module_version_specification_to_select_one_module`
60 - :ref:`module_version_specification_to_check_compatibility`
61
62 - module alias and symbolic version resolution triggered by
63
64 - ``module-info alias``
65 - ``module-info version``
66 - ``getPathToModule``
67 - ``isModuleEvaluated``
68
69 - the gathering of all module alias and symbolic version targeting a given module
70
71 - this is processed by ``getAllModuleResolvedName`` procedure
72 - which is called by
73
74 - ``doesLoadingModuleMatchesName``
75 - ``cmdModuleLoad``
76
77 - Note that whatis specification passed as argument to the ``search`` sub-command is always matched in a case insensitive manner
78
79 Corner cases
80 ------------
81
82 - When looking for the best match among loaded modules to select one module to unload, lastly loaded module, or firstly loaded module depending on :mconfig:`unload_match_order` configuration, will be returned
83
84 - When insensitive case is enabled, last or first icase match will be returned even if an exact match is present among the loaded module list
85 - This behavior has an impact in case multiple available modules correspond to the same insensitive case string
86
87 - For instance *iCaSe* and *IcAsE* modules
88
89 - When ``icase`` is enabled on all contexts and multiple directories match same icase module name
90
91 - for instance following modules exist: *ICASE/1.1*, *icase/1.2*, *iCaSe/1.3* and *iCaSe/1.4*
92 - a ``module avail -i icase`` will sort *iCaSe/1.4* as the highest entry
93 - however a ``module load -i icase`` command will load *icase/1.2*
94
95 - as *icase* directory matches query
96
97 - and also ``module load -i ICase`` command will load *icase/1.2*
98
99 - as no directory *ICase* exists, result is returned from highest directory: *icase*
100
101 .. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: