Skip to content

Commit 631bc88

Browse files
committed
tcl/lua: Remove useless '$*' parameter for shell alias
Shell alias are substitued in place on shells (either sh or csh family), thus the arguments set on the command line will be left untouched. So there is no need to append the list of argument at the end of the shell alias definition.
1 parent 188d496 commit 631bc88

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

shpc/main/modules/templates/docker.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ conflict(myModuleName(){% if aliases %}{% for alias in aliases %},"{{ alias.name
5858

5959
-- exec functions to provide "alias" to module commands
6060
{% if aliases %}{% for alias in aliases %}
61-
set_shell_function("{{ alias.name }}", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} " --entrypoint {{ alias.entrypoint }} " .. containerPath .. " {{ alias.args }} $@", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} " --entrypoint {{ alias.entrypoint }} " .. containerPath .. " {{ alias.args }} $*")
61+
set_shell_function("{{ alias.name }}", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} " --entrypoint {{ alias.entrypoint }} " .. containerPath .. " {{ alias.args }} $@", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} " --entrypoint {{ alias.entrypoint }} " .. containerPath .. " {{ alias.args }}")
6262
{% endfor %}{% endif %}
6363

6464
{% if aliases %}
@@ -68,10 +68,10 @@ if (myShellName() == "bash") then
6868
end{% endif %}
6969

7070
-- A customizable exec function
71-
set_shell_function("{|module_name|}-exec", execCmd .. " --entrypoint \"\" " .. containerPath .. " $@", execCmd .. " --entrypoint \"\" " .. containerPath .. " $*")
71+
set_shell_function("{|module_name|}-exec", execCmd .. " --entrypoint \"\" " .. containerPath .. " $@", execCmd .. " --entrypoint \"\" " .. containerPath)
7272

7373
-- Always provide a container run
74-
set_shell_function("{|module_name|}-run", runCmd .. " $@", runCmd .. " $*")
74+
set_shell_function("{|module_name|}-run", runCmd .. " $@", runCmd)
7575

7676
-- Inspect runscript or deffile easily!
7777
set_shell_function("{|module_name|}-inspect", inspectCmd, inspectCmd)

shpc/main/modules/templates/docker.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ set-alias {|module_name|}-shell "${shellCmd}"
6868

6969
# exec functions to provide "alias" to module commands
7070
{% if aliases %}{% for alias in aliases %}
71-
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }} {% endif %} --entrypoint {{ alias.entrypoint }} ${containerPath} {{ alias.command }} $*"
71+
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }} {% endif %} --entrypoint {{ alias.entrypoint }} ${containerPath} {{ alias.command }}"
7272
{% endfor %}{% endif %}
7373

7474
# A customizable exec function
75-
set-alias {|module_name|}-exec "${execCmd} --entrypoint \"\" ${containerPath} $*"
75+
set-alias {|module_name|}-exec "${execCmd} --entrypoint \"\" ${containerPath}"
7676

7777
# Always provide a container run
78-
set-alias {|module_name|}-run "${runCmd} $*"
78+
set-alias {|module_name|}-run "${runCmd}"
7979

8080
# Inspect runscript or deffile easily!
81-
set-alias {|module_name|}-inspect "${inspectCmd} ${containerPath} $*"
81+
set-alias {|module_name|}-inspect "${inspectCmd} ${containerPath}"
8282

8383
#=====
8484
# Module options

shpc/main/modules/templates/singularity.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ conflict(myModuleName(){% if aliases %}{% for alias in aliases %},"{{ alias.name
6363

6464
-- exec functions to provide "alias" to module commands
6565
{% if aliases %}{% for alias in aliases %}
66-
set_shell_function("{{ alias.name }}", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} containerPath .. " {{ alias.command }} $@", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} containerPath .. " {{ alias.command }} $*")
66+
set_shell_function("{{ alias.name }}", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} containerPath .. " {{ alias.command }} $@", execCmd .. {% if alias.options %} "{{ alias.options }} " .. {% endif %} containerPath .. " {{ alias.command }}")
6767
{% endfor %}{% endif %}
6868

6969
{% if aliases %}
@@ -73,10 +73,10 @@ if (myShellName() == "bash") then
7373
end{% endif %}
7474

7575
-- A customizable exec function
76-
set_shell_function("{|module_name|}-exec", execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} $@", execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} $*")
76+
set_shell_function("{|module_name|}-exec", execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} $@", execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS}")
7777

7878
-- Always provide a container run
79-
set_shell_function("{|module_name|}-run", runCmd .. " $@", runCmd .. " $*")
79+
set_shell_function("{|module_name|}-run", runCmd .. " $@", runCmd)
8080

8181
-- Inspect runscript or deffile easily!
8282
set_shell_function("{|module_name|}-inspect-runscript", inspectCmd .. " -r " .. containerPath, inspectCmd .. containerPath)

shpc/main/modules/templates/singularity.tcl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,19 @@ set runCmd "singularity \${SINGULARITY_OPTS} run \${SINGULARITY_COMMAND_OPTS} {%
7373
set inspectCmd "singularity \${SINGULARITY_OPTS} inspect \${SINGULARITY_COMMAND_OPTS} "
7474

7575
# set_shell_function takes bashStr and cshStr
76-
set-alias {|module_name|}-shell "${shellCmd} $*"
76+
set-alias {|module_name|}-shell "${shellCmd}"
7777

7878

7979
# exec functions to provide "alias" to module commands
8080
{% if aliases %}{% for alias in aliases %}
81-
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }} {% endif %} ${containerPath} {{ alias.command }} $*"
81+
set-alias {{ alias.name }} "${execCmd} {% if alias.options %} {{ alias.options }} {% endif %} ${containerPath} {{ alias.command }}"
8282
{% endfor %}{% endif %}
8383

8484
# A customizable exec function
85-
set-alias {|module_name|}-exec "${execCmd} ${containerPath} \${SINGULARITY_COMMAND_ARGS} $*"
85+
set-alias {|module_name|}-exec "${execCmd} ${containerPath} \${SINGULARITY_COMMAND_ARGS}"
8686

8787
# Always provide a container run
88-
set-alias {|module_name|}-run "${runCmd} $*"
88+
set-alias {|module_name|}-run "${runCmd}"
8989

9090
# Inspect runscript or deffile easily!
9191
set-alias {|module_name|}-inspect-runscript "${inspectCmd} -r ${containerPath}"

0 commit comments

Comments
 (0)