That is an interesting option.
I should check if our users would be interested in the list working that way.
Individual users can turn it off (in bash/sh) with:
export MODULES_AVAIL_INDEPTH=0
(tested, and it works).
One (as in the person setting up a site - not something that should be included by default) could also define an alias (in bash/sh):
alias module-avail='module avail --no-indepth'
(tested this as well).
On 2024-08-13 12:25 PM, Xavier Delaruelle wrote:
> 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
>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
--
--------------------------------------------------------
The views and opinions expressed above are strictly
those of the author(s). The content of this message has
not been reviewed nor approved by any entity whatsoever.
--------------------------------------------------------
Paul FM Info: http://paulfm.com/~paulfm/
--------------------------------------------------------
|