Hello Marc,
As you would like to hide all module versions by default and only
display the available module names, I suggest you look at the
"avail_indepth" configuration option [1].
This option is enabled by default, but if you disable it only the top
directory level is reported on "module avail". You can list the
versions of a given module by specifying it as argument (e.g., module
avail foo/).
Quick demo:
❯ module avail
---------------- /path/to/modulefiles ----------------
bar/1 bar/2 foo/1 foo/2
Key:
modulepath
❯ module avail --no-indepth
---------------- /path/to/modulefiles ----------------
bar/ foo/
Key:
modulepath directory/
❯ module config avail_indepth 0
❯ module avail
---------------- /path/to/modulefiles ----------------
bar/ foo/
Key:
modulepath directory/
❯ module avail foo/
---------------- /path/to/modulefiles ----------------
foo/1 foo/2
Key:
modulepath
Regards,
Xavier
[1] https://modules.readthedocs.io/en/latest/module.html#mconfig-avail_indepth
Le mar. 13 août 2024 à 17:00, Marc Castells
<mar...@en...> a écrit :
>
> Hi,
>
> An example structure:
>
> + DIR_1
> + SUBDIR_A
> + 0.1
> + 0.2
> + 1.0
> + 2.0
> + ....
>
> DIR_1 is the path fed to the 'module use' command in the initrc file. The sub-directories inside it are expected to be recursively searched by the tool.
>
> I am trying to find a way to soft hide all individual modulefile versions inside SUBDIR_A in a module avail command but show the DIR_1/SUBDIR_A stub. The reason for this is that I have multiple SUBDIR_? (around 20), each with many modulefiles (from a few to 10s). The idea would be to use module avail to get a top level view of the available SUBDIR modules without the clutter inside each module directory. Regular users would simply invoke 'module load DIR_1/SUBDIR_A' and rely on default and/or current version specifier. For a finer selection within SUBDIR_A, the user would target 'module avail -a DIR_1/SUBDIR_A' and all the available versions would be displayed.
>
> I have tried the following with the module-hide feature but none have work:
> a) module-hide -soft DIR_1/SUBDIR_A
> b) module-hide -soft DIR_1/SUBDIR_A@<first_version>:<last_version>
> c) module-hide -soft DIR_1/SUBDIR_A@:
>
> a) and b) hide DIR_1/SUBDIR_A entirely. c) does not hide anything and all versions are displayed
>
> Is there a native way within the tool to support this functionality?
>
> Thanks
|