On Wed, May 23, 2012 at 7:05 PM, Michael Schwartz <[email protected]> wrote:
> Does it remove what it consumes from argc and argv?
>
i just came across this years-old snippet...
if(0)
{ /** f*** - SetFlagsFromCommandLine() changes argv such that the
"--" arg and those following it are stripped!
*/
typedef std::vector<char *> AV;
AV vargv(static_cast<size_t>(argc), 0);
int i;
for( i = 0; i < argc; ++i )
{
vargv[(unsigned int)i] = argv[i];
}
v8::V8::SetFlagsFromCommandLine(&i, &vargv[0], true);
}
else
{
// or we could use the undocumented 3rd arg:
//v8::V8::SetFlagsFromCommandLine(&argc, argv, false);
}
The first comment is where i remember having problems: anything after a
"--" argument is stripped completely. That was a problem for me because i
use -- to signal the start of args to pass to the client-supplied JS script
(as opposed to shell-level args).
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users