Closed
Description
- Version: v8.9.4
- Platform: 64-bit Mac (Darwin Kernel Version 15.6.0) && Linux 3.2.45-0.6.wd.865.49.315.metal1.x86_64
- Subsystem:
Current Behavior:
When eval'ing an inline script (node -e
) you can freely pass arguments, but if it's a flag that node understands it will evaluate that flag instead of running the inlined script.
Expected Behavior:
I would expect this behavior to match the behavior of running a non-eval'd script.
Example (inline):
$ node -e "console.log(process.argv)" "test"
[ '/Users/.../.nvm/versions/node/v8.9.4/bin/node', 'test' ]
$ node -e "console.log(process.argv)" -v
v8.9.4
Example (non-inline):
$ node test.js "test"
[ '/Users/.../.nvm/versions/node/v8.9.4/bin/node',
'/.../test.js',
'test' ]
$ node test.js -v
[ '/Users/.../.nvm/versions/node/v8.9.4/bin/node',
'/.../test.js',
'-v' ]