diff options
author | TJ Holowaychuk <tjholowayhuk@gmail.com> | 2010-10-06 19:05:01 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-06 19:09:22 -0700 |
commit | 9481bc1009765b24390239a1d7d88bebae5db731 (patch) | |
tree | 2465d345ac00f913f0c3edf0039fbe95ca0257b0 /src/node.js | |
parent | 5986a582d9d43d2a58ff5dd5f59377c280fac802 (diff) | |
download | node-new-9481bc1009765b24390239a1d7d88bebae5db731.tar.gz |
Added -e, --eval
Diffstat (limited to 'src/node.js')
-rw-r--r-- | src/node.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/node.js b/src/node.js index 7d177eb6ce..1ad5576bc9 100644 --- a/src/node.js +++ b/src/node.js @@ -577,17 +577,21 @@ if (process.argv[0].indexOf('/') > 0) { } if (process.argv[1]) { + // Load module if (process.argv[1].charAt(0) != "/" && !(/^http:\/\//).exec(process.argv[1])) { process.argv[1] = path.join(cwd, process.argv[1]); } - // REMOVEME: nextTick should not be necessary. This hack to get // test/simple/test-exception-handler2.js working. process.nextTick(function() { module.runMain(); }); + +} else if (process._eval) { + // -e, --eval + if (process._eval) console.log(eval(process._eval)); } else { - // No arguments, run the repl + // REPL module.requireNative('repl').start(); } |