Why would a user do this (except for testing)?
The error they get is obvious (once you understand what the implicit setting does).
Enforcing it, is overkill.
I think the second best option is to define EXPLICIT defaults for your modules.
The best, is to just educate your users as to what implicit default does (and that they probably don't want to turn it off).
MODULES_IMPLICIT_DEFAULT
Defines (if set to 1) or not (if set to 0) an implicit default version for modules without a default version explicitly defined (see
Locating Modulefiles section in the modulefile man page).
Without either an explicit or implicit default version defined a module must be fully qualified (version should be specified in addi-
tion to its name) to get:
• targeted by module load, switch, display, help, test and path sub-commands.
• restored from a collection, unless already loaded in collection-specified order.
• automatically loaded by automated module handling mechanisms (see MODULES_AUTO_HANDLING section) when declared as module require-
ment, with prereq or module load modulefile commands.
An error is returned in the above situations if either no explicit or implicit default version is defined.
On 1/13/2024 9:50 AM, Baudilio Tejerina - NOAA Affiliate via Modules-interest wrote:
> Hello,
>
> We need to enforce ‘implicit_default’ at out site.
>
> Is it possible to catch errors such as
>
> $ module config implicit_default 0
> $ module load foo
> ERROR: No default version defined for 'foo'
>
>
> so that that I can inform users with possible, alternative, available actions?
>
>
> Thank You!
> Baudilio
>
>
>
> _______________________________________________
> 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/
--------------------------------------------------------
|