Skip to content

"--" after "-e <script>" means end-of-options

Rodrigo Muino Tomonari requested to merge github/fork/jBarz/issue9017 into master

There is currently no way to pass the first argument to an eval script that starts with a hyphen.

node -e 'console.log(process.argv)' -arg1 [ '/usr/bin/node' ]

node -e 'console.log(process.argv)' -- -arg1 [ '/usr/bin/node' ]

After this fix node -e 'console.log(process.argv)' -- -arg1 [ '/usr/bin/node', '-arg1' ]

Checklist
  • make -j4 test (UNIX)
  • tests added
  • commit message follows commit guidelines
Affected core subsystem(s)

Merge request reports

Loading