When using `[positional-arguments]`, "$@" is not expanded in a command's echo
Say I have a task
[positional-arguments]
run *args:
scala-cli run . -- "$@"
When i run this task with
just run --myflag myarg
I get the output
scala-cli run . -- "$@"
...
However it would be more helpful to have echoed the real positional arguments I had provide, i.e.:
scala-cli run . -- --myflag myarg
...
I agree that echoing positional arguments would be helpful and I too would like this for some of my justfile recipes, but what would be the best way to present positional arguments?
Expanding "$@" is probably not the solution. The echoed command is printed by just itself. In just the shell is not necessarily a Bourne-like shell, it could be any scripting language, so just doesn't have any way to be sure what "$@" or other positional argument specifiers are supposed to expand to (if anything) or what is the correct way to insert/quote each argument for the shell's language.
If there is a good way to add echoing of positional arguments while keeping recipe lines echoed as they are now, then +1 from me.
Thanks for chiming in, @laniakea64.
Expanding
"$@"is probably not the solution. The echoed command is printed byjustitself.
Just obviously has the arguments in some internal representation. I assume it is a list of strings. It could plainly print this list, could it not?