From aa572abd6500d6e9270ada922efe2186da1ea022 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Fri, 3 Sep 2010 20:34:32 +0000 Subject: [PATCH] Add -n option to launch without debug library. --- src/jse/lua.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jse/lua.java b/src/jse/lua.java index d7d2ad8a..056c2d86 100644 --- a/src/jse/lua.java +++ b/src/jse/lua.java @@ -52,6 +52,7 @@ public class lua { " -v show version information\n" + " -j use lua2java source-to-source compiler\n" + " -b use luajc bytecode-to-bytecode compiler (requires bcel on class path)\n" + + " -n nodebug - do not load debug library by default\n" + " -- stop handling options\n" + " - execute stdin and stop handling options"; @@ -64,13 +65,11 @@ public class lua { public static void main( String[] args ) throws IOException { - // new lua state - _G = JsePlatform.debugGlobals(); - // process args boolean interactive = (args.length == 0); boolean versioninfo = false; boolean processing = true; + boolean nodebug = false; try { // stateful argument processing for ( int i=0; i 2 ) usageExit(); @@ -115,6 +117,9 @@ public class lua { } } } + + // new lua state + _G = nodebug? JsePlatform.standardGlobals(): JsePlatform.debugGlobals(); // echo version if ( versioninfo )