Skip to content

no error when omitting variant specification on a module display #406

@xdelaruelle

Description

@xdelaruelle

When a module defines variants, they should be specified for any module evaluation.

$ ml show foo  
-------------------------------------------------------------------
/path/to/modulefiles/foo/1.0:
 
variant         --boolean bar
ERROR: No value specified for variant 'bar'
  Allowed values are: 1 0 yes no true false on off
-------------------------------------------------------------------

In case of a display evaluation it is a bit harsh to ask for all variant without a default value defined to be specified. As module display may be invoked to understand what are the variants defined by the module.

It seems better to help users understand modulefile content to report variants without an error is no value is provided, then maybe end in error if the modulefile make use of the variant value later in the code, but at least user will obtain all the information on variants if they have been correctly defined at the start of the modulefile.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions