diff --git a/doc/source/design/hide-or-forbid-modulefile.rst b/doc/source/design/hide-or-forbid-modulefile.rst index b5d2e31a..49d6d06a 100644 --- a/doc/source/design/hide-or-forbid-modulefile.rst +++ b/doc/source/design/hide-or-forbid-modulefile.rst @@ -112,7 +112,9 @@ Specification - is excluded from ``module avail mod@:2`` result, even if default symbol targets it - is included in ``module avail mod@1.0,2.0`` result - - Included in module resolution result if ``--all`` option of ``avail``, ``is-avail``, ``whatis``, ``search`` and ``aliases`` sub-commands is set + - Included in module resolution result if ``--all`` option of ``avail``, ``whatis``, ``search`` and ``aliases`` sub-commands is set + + - ``--all`` option does not apply to ``is-avail`` sub-command to make it coherent with ``load`` sub-command (eg. a ``is-avail mod`` returning true implies ``load mod`` effectively loading a module) - Visibility of a module targeted by a ``module-hide`` command acts similarly than for a file whose name is prefixed by a dot character on Unix platform diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index fc0db645..597b707e 100644 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -9588,8 +9588,7 @@ proc parseModuleCommandArgs {cmd args} { } --all { # include hidden modules only on a limited set of command - if {[isInList [list avail aliases is-avail search whatis ml]\ - $cmd]} { + if {[isInList [list avail aliases search whatis ml] $cmd]} { setState hiding_threshold 2 } else { lappend otherargs $arg @@ -9600,8 +9599,7 @@ proc parseModuleCommandArgs {cmd args} { # one of the search/listing sub-commands if {$cmd eq {use}} { set addpath_pos append - } elseif {[isInList [list avail aliases is-avail search whatis\ - ml] $cmd]} { + } elseif {[isInList [list avail aliases search whatis ml] $cmd]} { setState hiding_threshold 2 } else { lappend otherargs $arg @@ -11883,7 +11881,7 @@ Listing / Searching commands: apropos | keyword | search [-a] [-j] str Search all name and whatis containing str is-loaded [modulefile ...] Test if any of the modulefile(s) are loaded - is-avail [-a] modulefile [...] Is any of the modulefile(s) available + is-avail modulefile [...] Is any of the modulefile(s) available info-loaded modulefile Get full name of matching loaded module(s) Collection of modules handling commands: diff --git a/testsuite/modules.20-locate/113-hide-all-opt.exp b/testsuite/modules.20-locate/113-hide-all-opt.exp index c75de6e5..353a8841 100644 --- a/testsuite/modules.20-locate/113-hide-all-opt.exp +++ b/testsuite/modules.20-locate/113-hide-all-opt.exp @@ -52,6 +52,9 @@ testouterr_cmd sh {-a avail -t hide3/sym} ERR "$error_msgs: Invalid command '-a' # no effect on selection context testouterr_cmd sh {load -a hide2} ERR $err_path'-a'\n$err_path'hide2' testouterr_cmd sh {load hide2@default --all} ERR $err_path'hide2@default'\n$err_path'--all' +# no effect on is-avail +testouterr_cmd sh {is-avail -a hide3} ERR {} +testouterr_cmd sh {is-avail hide3 --all} ERR {} # test on avail testouterr_cmd sh {avail -a -t hide1@2:4} OK $mp:\nhide1/2.0\nhide1/2.1\nhide1/2.2\nhide1/3.0\nhide1/3.1(default)\nhide1/3.2\nhide1/4.0 @@ -72,9 +75,6 @@ testouterr_cmd_re sh {whatis hide1@3,4 -a} OK "$tserr\n\\s+hide1/3.0: hide1/3.0\ # result starts by an extra newline, which may be caused by the errors caught when evaluating all modules testouterr_cmd_re sh {search -a hide3} ERR "\n$tserr\n\\s+hide3/1.0: hide3/1.0\n\\s+hide3/sub1/2.0: hide3/sub1/2.0\n\\s+hide3/sub1/3.0: hide3/sub1/3.0\n\\s+hide3/sub2/4.0: hide3/sub2/4.0\n\\s+hide3/sub2/5.0: hide3/sub2/5.0" -# test on is-avail -testouterr_cmd sh {is-avail -a hide3} OK {} - # test aliases testouterr_cmd_re sh {aliases -a} OK "$modlin Aliases $modlin (.*)+