@@ -18,19 +18,19 @@ proc ModulesHelp { } {
1818 puts stderr " Commands include:"
1919 puts stderr " "
2020 puts stderr " - {|module_name|}-run:"
21- puts stderr " singularity run {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}<container>"
21+ puts stderr " singularity run {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}<container> \"\$ @ \" "
2222 puts stderr " - {|module_name|}-shell:"
2323 puts stderr " singularity shell -s {{ singularity_shell }} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}<container>"
2424 puts stderr " - {|module_name|}-exec:"
25- puts stderr " singularity exec {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}<container> $* "
25+ puts stderr " singularity exec {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}<container> \"\$ @ \" "
2626 puts stderr " - {|module_name|}-inspect-runscript:"
2727 puts stderr " singularity inspect -r <container>"
2828 puts stderr " - {|module_name|}-inspect-deffile:"
2929 puts stderr " singularity inspect -d <container>"
30- puts stderr " "
30+ puts stderr " "
3131{% if aliases %}{% for alias in aliases %} puts stderr " - {{ alias.name }}:"
32- puts stderr " singularity exec {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}{% if alias.singularity_options %}{{ alias.singularity_options | replace(" $" , " \$ " ) }} {% endif %}<container> {{ alias.command | replace(" $" , " \$ " ) }}"
33- {% endfor %}{% else %} puts stderr " - {|module_name|}: singularity run {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace( " $ " , " \$ " ) }} --home {{ features.home | replace( " $ " , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace( " $ " , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %}<container> " {% endif %}
32+ puts stderr " singularity exec {% if features.gpu %}{{ features.gpu }} {% endif %}{% if features.home %}-B {{ features.home | replace(" $" , " \$ " ) }} --home {{ features.home | replace(" $" , " \$ " ) }} {% endif %}{% if features.x11 %}-B {{ features.x11 | replace(" $" , " \$ " ) }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }} {% endif %}{% if alias.singularity_options %}{{ alias.singularity_options | replace(" $" , " \$ " ) }} {% endif %}<container> {{ alias.command | replace(" $" , " \$ " ) }} \"\$ @ \" "
33+ {% endfor %}{% endif %}
3434 puts stderr " "
3535 puts stderr " For each of the above, you can export:"
3636 puts stderr " "
@@ -82,7 +82,7 @@ set-alias {|module_name|}-shell "${shellCmd}"
8282{% if aliases %}
8383if { [ module-info shell bash ] } {
8484 if { [ module-info mode load ] } {
85- {% for alias in aliases %} puts stdout " function {{ alias.name }}() { ${execCmd} {% if alias.singularity_options %} {{ alias.singularity_options | replace(" $" , " \$ " ) }} {% endif %} ${containerPath} {{ alias.command | replace(" $" , " \$ " ) }} \$ @ ; }; export -f {{ alias.name }};"
85+ {% for alias in aliases %} puts stdout " function {{ alias.name }}() { ${execCmd} {% if alias.singularity_options %} {{ alias.singularity_options | replace(" $" , " \$ " ) }} {% endif %} ${containerPath} {{ alias.command | replace(" $" , " \$ " ) }} \"\$ @ \" ; }; export -f {{ alias.name }};"
8686{% endfor %}
8787 }
8888 if { [ module-info mode remove ] } {
@@ -96,10 +96,18 @@ if { [ module-info shell bash ] } {
9696{% endif %}
9797
9898# A customizable exec function
99- set -alias {|module_name|}-exec " ${execCmd} ${containerPath} "
99+ if { [ module-info shell bash ] } {
100+ set -alias {|module_name|}-exec " ${execCmd} ${containerPath} \"\$ @\" "
101+ } else {
102+ set -alias {|module_name|}-exec " ${execCmd} ${containerPath} "
103+ }
100104
101105# Always provide a container run
102- set -alias {|module_name|}-run " ${runCmd} "
106+ if { [ module-info shell bash ] } {
107+ set -alias {|module_name|}-run " ${runCmd} \"\$ @\" "
108+ } else {
109+ set -alias {|module_name|}-run " ${runCmd} "
110+ }
103111
104112# Inspect runscript or deffile easily!
105113set -alias {|module_name|}-inspect-runscript " ${inspectCmd} -r ${containerPath} "
0 commit comments