Issue 39: Provide for passing arguments to scripts
http://code.google.com/p/v8/issues/detail?id=39

New issue report by mdmkolbe:
At present there seems to be no way of passing arguments to a "./shell"
script.  There should be one.  I have attached a patch that implements this
and listed some example usages below.

This only an example interface.  Others are certainly possible, but any
interface must account both for (1) multiple source files, (2) multiple
arguments, and (2) the "--shell" option.

$ cat my-script-1.js
print(arguments.length);

$ cat my-script-2.js
print(arguments);

$ ./shell my-script-1.js my-script-2.js -- arg1 arg2
2
arg1,arg2

$ ./shell my-script-1.js my-script-2.js -- --shell arg1 arg2
3
--shell,arg1,arg2

$ ./shell my-script-1.js my-script-2.js --shell -- arg1 arg2
2
arg1,arg2
V8 version 0.3.0
>

$ ./shell -- arg1 arg2
V8 version 0.3.0
> arguments
arg1,arg2
>

$ ./shell --shell -- arg1 arg2
V8 version 0.3.0
> arguments
arg1,arg2
>

$ ./shell -- --shell arg1 arg2
V8 version 0.3.0
> arguments
--shell,arg1,arg2
>


Attachments:
        arguments.patch  1.2 KB


Issue attributes:
        Status: New
        Owner: ----

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to