TACC / Lmod

Lmod: An Environment Module System based on Lua, Reads TCL Modules, Supports a Software Hierarchy
http://lmod.readthedocs.org
Other
489 stars 126 forks source link

module use --help / -h unexpected behavior #697

Closed pavelToman closed 3 months ago

pavelToman commented 6 months ago

There is a problem with command module use -h and module use --help. It adds ~/-h or ~/--help to $MODULEPATH instead of showing the help. ml use -h and ml use --help works correctly.

Operating System: Red Hat Enterprise Linux 8.8 (Ootpa) CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos Kernel: Linux 4.18.0-477.43.1.el8_8.x86_64 Architecture: x86-64 Lmod Version: Modules based on Lua: Version 8.7.4

rtmclay commented 6 months ago

This not a bug. All options come before a command. So::

% module --help use

is correct.

where as:

% module use --help

adds ~/--help to $MODULEPATH

boegel commented 6 months ago

@rtmclay It is a bit counterintuitive though (I asked @pavelToman to report this directly when he mentioned it to me)

rtmclay commented 6 months ago

What I said before is still true. All options must be specified before the command:

% module <option(s)> command
% ml         <options> command

So this means that

% module use --help

will add $PWD/--help to $MODULEPATH

However

% ml use --help

should to the same thing as module use --help. I have modified the testing branch so that both commands now do the same thing.

Please try the testing branch out to see that it works for you.

rtmclay commented 6 months ago

This change has now been merged into the main branch and has been released as Lmod 8.7.36.

boegel commented 5 months ago

@rtmclay As discussed during today's Lmod monthly call, maybe a warning could be printed when the use of --help looks "fishy", something like:

$ module use --help
Warning: adding '--help' to $MODULEPATH, maybe you intended to use `module --help use`?
rtmclay commented 3 months ago

See the release of Lmod 8.7.39 to see if this solves your problem.

rtmclay commented 3 months ago

I'm closing this issue. Feel free to re-open this issue if necessary.