
On 9/26/20 10:51 AM, Wolfgang Denk wrote:
Dear Heinrich,
In message 99821acf-b921-2c06-05b8-dd32058f28f2@gmx.de you wrote:
For me this could be realized by enhancing the run command to allow:
run varname1 varname2 ... varnameN --args argv1 argv2 argv3
Arguments argv1, argv2, ... are passed to the script identified by the last variable (varnameN).
Nice idea! Only we should do a better syntax (options preceeding argument), i. e.
run [ --args argv ] varname1 varname2 ...
where argv would be the name of a variale to hold the arguments (as a comma (?) separated list) ?
In another mail you suggested "run arg1 arg2 ... -- varname1 varname2".
Whether arguments or script names are first or last does not make much of a difference for the implementation effort. Any way you have to loop over all arguments to find the separator "--".
"better syntax" does not apply here as the two alternatives have the same expressivity, and need the same amount of typing and learning. It is a matter of taste.
Do you have an idea how the "script" would pull out the arguments from that variable?
Rasmus already suggested $1 .. $9 for the positional arguments (where counting should not stop at 9).
Best regards
Heinrich
Best regards,
Wolfgang Denk