the new run is only an executable-to-run-and-args specifier. it specifies args not an action. The two are (still) decoupled
i.e the default simple case
- Code: Select all
cobra x.cobra #compile x.cobra to x,exe, run x.exe with no args
can be thought of as this cmd line with everything explicit
- Code: Select all
cobra -run-exe x.cobra -run x.exe
more complicated cases ( multi file compile and multi args to the executable to run) fall/follow out of that
also
the new -run is position sensitive - it needs to be the last option on the cmdline ( since it sucks all remaining args)
the old one has no such dependency ( nor does -run-exe)
A file wouldnt be specified twice (unless you wanted to be really explicit) - normally you'd use the -run-args option - at least thats what I've been doing mostly
- Code: Select all
cobra x.cobra -run-args a b c
cobra x.cobra -- a b c
I expect there could be more defaulting and arg shifting so that a single unspecified compile file could be inferred from the first option of the -run arglist ,
or preclude cobra from running an arbitrary executable by adding the executable ( name suitably modded) to the front of the compile file list
if it wasnt already there or any number of other things.
This patch (none of these patches) do that or have ever done that.
Its probable that if the intention was to support what D does then this change ( -run, -run-args) was the first step to that and it never got beyond ( or even to) that.
I imagine the only real use for this (-run executable args) as it currently stands would be when building a referenced library that you wanted to test run against
(ask dennis what he was thinking when he requested this) but maybe I just havent come across the right set of build/run cases yet.
I've not ever used it apart from making everything that I want to happen really explicit.
The example with -t was assuming the prior existnce of a executable (x.exe) that referenced the lib being built ( and found it where cobra left it after the compilation) so no the compile step still only builds the lib ( xlib.dll)
As originally presented/implemented the compile step built an executable from a set of files and the execute step ran that executable.
The (new) -run option decouples those so that you can possibly run something other than the thing just built