On Sun, 12 Aug 2012 23:02:43 +0200, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote:

On 8/12/12, Simen Kjaeraas <simen.kja...@gmail.com> wrote:
     // Array of pointers to command line parameters.
     char*[] argv = args.map!((a)=>(a.dup~'\0').ptr).array;

You know.. it'd be much simpler if argc & argv were stored somewhere.
druntime/src/rt/dmain2.d is where the action begins:

extern (C) int main(int argc, char** argv) { ... }

And then this is stored as a string[] to _d_args which can be picked
up via Runtime.args() in core.runtime.

I'm thinking that having to retrieve the original argc/argv is common
when interfacing with C/C++, so maybe we should have a druntime
function which can return the original unprocessed args?

That don't sound too stupid. File an enhancement request, wouldya?

--
Simen

Reply via email to