Commit Graph

3241 Commits

Author SHA1 Message Date
Xavier Delaruelle
fcfc0ead96 doc: desc. SGR mechanism for tags in design doc 2020-12-18 18:58:53 +01:00
Xavier Delaruelle
0aca1ecc78 ts: test cumulative sgr codes in 00/140 2020-12-18 18:58:53 +01:00
Xavier Delaruelle
3810074ee5 Render multiple tags and hightlight matching substr
Update sgr procedure to render multiple other keys applying to the
string, by applying each of these keys to a sub part of string, yet
mixing with matching sub string highlight.
2020-12-18 18:58:53 +01:00
Xavier Delaruelle
17758a6a55 Apply tag sgr keys to element
When tags apply to a module to display, apply to this module name the
sgr keys that are defined to represent the tags. Each module tag
matching a sgr code is then graphically represented over module name and
not reported by its tag name or abbreviated name.

If an abbreviation exists for tag name, sgr key is matched against this
abbreviated string. If no abbreviation exists for a tag, sgr key is
matched against tag full name.

Currently only graphically render single tag.
2020-12-18 18:58:53 +01:00
Xavier Delaruelle
bb4fdb8df7 Handle matching substring hightlight in sgr proc 2020-12-18 18:58:53 +01:00
Xavier Delaruelle
4c51788960 Render default sym through single sgr elt processing 2020-12-18 18:58:53 +01:00
Xavier Delaruelle
49b08c3366 Add the ability to apply multiple sgr keys 2020-12-18 18:58:52 +01:00
Xavier Delaruelle
4c6ccd6952 Remove useless tagsgr arg on formatListEltToDisplay 2020-12-18 18:58:52 +01:00
Xavier Delaruelle
4051cbc01c doc: desc. MODULES_TAG_ABBREV in module(1) man 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
f716abbedd ts: check tag abbrev in 70/321 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
f9e83b52c6 doc: desc. tag abbrev in module tags design 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
15e9d4ed80 ts: adapt existing tests for tag abbrev 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
56858e536d ts: adapt tests for tag_abbrev config 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
29b909289a Abbreviate tags when reporting them on avail/list
Use abbreviation defined for each tag if any to report them over the
avail and list sub-command output result.
2020-12-18 18:58:37 +01:00
Xavier Delaruelle
0aba0b4437 init: add tag_abbrev config to completion scripts 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
87180618d3 doc: desc. MODULES_TAG_ABBREV in diff doc 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
979349da7d Add tag_abbrev configuration 2020-12-18 18:58:37 +01:00
Xavier Delaruelle
38503acfa3 Separate tags with ':' instead of ','
When reporting module tags on avail and list sub-commands, use ':'
character to separate multiple tags applying to the same module.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
4e6319be9d Raise error when reserved tag name is set
Raise an error when a reserved tag name is defined with module-tag.
Reserved names are currently: loaded, auto-loaded, forbidden,
nearly-forbidden and hidden.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
7b745207de ts: clear MODULES_LMTAG prior test start 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
d371aac50a install: clear git remote in build ref tag 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
f39987d965 doc: desc. inherited tag from module-{hide,forbid} 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
43f89a2508 Update isModuleTagged to fetch info from collected tags
Add the collected argument to the isModuleTagged procedure to get the
ability to query tag information for designed modulefile from collected
tags data for module rather raw tag definition applying to module
specification.

Enable this query mode to determine if module is nearly-forbidden in
execute-modulefile procedure (as tags for evaluated modules are fetched
right before this test).

Disable 'nearly-forbidden' tag check when performing an unload
evaluation.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
0811ee7a51 doc: desc. initial module tag work in NEWS 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
310e92531e doc: desc. module-tag in modulefile(4) 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
d8a5e191a7 ts: adapt existing tests for 'module-info tags' change 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
aaef422d69 doc: desc MODULES_LMTAG in module(1) man 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
feba5e0878 ts: add tests for module-tag in 50/{288,440} 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
9c596c9c8e ts: test module-info tags on all eval contexts 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
6ffc724791 doc: desc. MODULES_TAG on diff doc 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
c09e83b0c4 doc: desc. module-tag in diff doc 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
1b4278acea vim: add new modulefile command 'module-tag' 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
04f41a4fef Fetch tags before starting modulefile eval
Collect all tags applying to the modulefile that need to be evaluated
right before the start of its evaluation. It enables to get the accurate
tag information during modulefile evaluation whatever the kind of
evaluation (load, unload, display, help, ...). Disable mechanism for
source and unsource evaluation contexts.

In case current user environment state is inconsistent, do not break the
whole modulefile evaluation.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
166098a9a1 Introduce 'module-tag' modulefile command
Introduce the `module-tag` modulefile command to enable users to
associate their own tag to modulefiles. These tags are reported on
`avail` and `list` sub-command outputs.

This new command is intended to be used in modulerc evaluation context.
It is also recorded for modulefile evaluation context as it corresponds
to the evaluation context of the global and user RCs.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
f77136656b Make --{after,before} optional in parseApplicationCriteriaArgs
Add the `aftbef` argument to the parseApplicationCriteriaArgs procedure
to optionally support the --after and --before command-line switches. If
support disabled (aftbef set to 0) an argument equal to --after or
--before is treated as regular content.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
40ceac528e doc: desc module-info tags in modulefile(4) man 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
f841266dfc doc: desc. module-info tags in diff doc 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
598aaaa41b ts: test 'module-info tags' in 50/288 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
e6467ec3a2 Add tags sub-command to module-info modulefile command
Introduce the `tags` sub-command to the module-info modulefile command
to return the list of tags applying to currently evaluated module or
tell if tag specified as argument applyes to this module.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
11d5df1085 ts: adapt existing tests to 'hidden' tag 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
6c63b254af Apply 'hidden' tag to module defined hidden
Set a `hidden` tag for each module targetted by a hidden definition
coming whether from a module-hide statement or by module name or version
starting with a dot character.

The `hidden` tag is not exported in MODULES_LMTAG for loading module as
the hidden state concerns the `avail` report only.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
a00900f1cc ts: test loaded/auto-loaded tags in 70/320 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
2c456f9a11 ts: test tags output on list sub-cmd in 70/320 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
c5081a15ea Output tags along module on list subcmd
Output the tags of the modules returned by the list sub-command. Adapt
module list regular and json output styles to include these tags
(enclosed in <> like for avail sub-command).

No output of tags on terse output mode as nothing other than module name
is displayed on this mode currently.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
2700eba39e ts: test MODULES_LMTAG in 70/320 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
6e4ba11a97 ts: adapt existing tests for MODULES_LMTAG 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
483ebd33a7 Record tags of loaded mods in MODULES_LMTAG env var
Record in user environment the tags applying to loaded modules. Making
this information persist in environment via MODULES_LMTAG variable helps
to report them on `list` sub-command and to remember these tags when the
module will be unloaded.
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
5afe04cd1b ts: test tags output on avail sub-cmd in 90/100 2020-12-18 18:58:26 +01:00
Xavier Delaruelle
2a18b4b31e Apply getModules phase 5 only for avail subcmd
Consolidate tags set for the modules returned by getModules procedure
only if called from an avail sub-command, as these informations are
only useful for this context (list sub-command does not rely on
getModules).
2020-12-18 18:58:26 +01:00
Xavier Delaruelle
785fd32004 ts: adapt existing tests for tag output on avail 2020-12-18 18:58:26 +01:00