changeset 781:9367508842b2

testcase.js accept argument from command line
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 30 Aug 2010 19:20:20 +0800
parents 16d8a1d48717
children e3d8e7787836 a47431293043
files nodejs/testcase.js
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/testcase.js	Mon Aug 30 17:42:15 2010 +0800
+++ b/nodejs/testcase.js	Mon Aug 30 19:20:20 2010 +0800
@@ -1,13 +1,11 @@
 var mbfly = require("mbfly");
 var r = mbfly.Hello(" test");
 var sys = require("sys");
-/* process module is still not supported by nodejs v0.1.97 */
-/* var process = require("process"); */
 sys.puts(r);
 
 var display_name = ":0.0";
-/* if(process.argv.length > 2)
-   display_name = process.argv[2]; */
+if(process.argv.length == 3)
+   display_name = process.argv[2];
 
 var mb_rt = new mbfly.mb_rt(display_name, 300, 200);
 var root = mb_rt.root;