@@ -18,19 +18,19 @@ proc ModulesHelp { } {
18
18
puts stderr " Commands include:"
19
19
puts stderr " "
20
20
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> \"\$ @ \" "
22
22
puts stderr " - {|module_name|}-shell:"
23
23
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>"
24
24
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> \"\$ @ \" "
26
26
puts stderr " - {|module_name|}-inspect-runscript:"
27
27
puts stderr " singularity inspect -r <container>"
28
28
puts stderr " - {|module_name|}-inspect-deffile:"
29
29
puts stderr " singularity inspect -d <container>"
30
- puts stderr " "
30
+ puts stderr " "
31
31
{% 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 %}
34
34
puts stderr " "
35
35
puts stderr " For each of the above, you can export:"
36
36
puts stderr " "
@@ -82,7 +82,7 @@ set-alias {|module_name|}-shell "${shellCmd}"
82
82
{% if aliases %}
83
83
if { [ module-info shell bash ] } {
84
84
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 }};"
86
86
{% endfor %}
87
87
}
88
88
if { [ module-info mode remove ] } {
@@ -96,10 +96,18 @@ if { [ module-info shell bash ] } {
96
96
{% endif %}
97
97
98
98
# 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
+ }
100
104
101
105
# 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
+ }
103
111
104
112
# Inspect runscript or deffile easily!
105
113
set -alias {|module_name|}-inspect-runscript " ${inspectCmd} -r ${containerPath} "
0 commit comments