|
For TOML tasks without shebang, extra argument are passed to the last command, as documented in https://mise.en.dev/tasks/running-tasks.html. But for a TOML task with, for example Bash shebang, the current (mise v2026.7.13) behavior is that extra arguments are not passed to any commands, but only accessible as It this the designed (though undocumented) behavior? [tasks.multiline]
run = '''
echo "1"
echo "2 [\$1=$1]"
echo "3"
'''
[tasks.multiline-shebang]
run = '''
#!/usr/bin/env bash
echo "1"
echo "2 [\$1=$1]"
echo "3"
''' |
Replies: 1 comment
|
Yes, this is intentional. A shebang task is executed as a script file, so extra arguments are available through the interpreter’s normal positional-argument mechanism ( If a task depends on particular arguments, defining them with I opened #11336 to clarify this distinction in the documentation and add regression coverage. This comment was generated by an AI coding assistant. |
Yes, this is intentional. A shebang task is executed as a script file, so extra arguments are available through the interpreter’s normal positional-argument mechanism (
$1/$@in Bash). The “passed to the last command” documentation refers to separate entries in arun = [...]array, not lines within a multiline script.If a task depends on particular arguments, defining them with
usageis recommended. That gives the task an explicit, validated interface instead of relying on implicit passthrough behavior.I opened #11336 to clarify this distinction in the documentation and add regression coverage.
This comment was generated by an AI coding assistant.