diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luac.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/luac.cc b/src/luac.cc index 421da3a..2aa8e28 100644 --- a/src/luac.cc +++ b/src/luac.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: luac.cc,v 1.3 2007-05-30 11:57:11 pixel Exp $ */ +/* $Id: luac.cc,v 1.4 2007-07-27 10:05:55 pixel Exp $ */ #include <getopt.h> @@ -44,6 +44,7 @@ void showhelp() { " -v sets verbosity.\n" " -d sets debug mode.\n" " -o <file> set output filename.\n" +" -l displays listing.\n" , argv[0]); } @@ -52,10 +53,11 @@ virtual int startup() throw (GeneralException) { char c; Lua * L = new Lua(); bool strip = true; + bool listing = false; char * output = "a.clua"; bool todo; - while ((c = getopt_long(argc, argv, "Hhvo:d", long_options, NULL)) != EOF) { + while ((c = getopt_long(argc, argv, "Hhvo:dl", long_options, NULL)) != EOF) { switch (c) { case 'h': case 'H': @@ -71,6 +73,9 @@ virtual int startup() throw (GeneralException) { case 'd': strip = false; break; + case 'l': + listing = true; + break; } } @@ -86,7 +91,7 @@ virtual int startup() throw (GeneralException) { return 0; } - L->dump(&Output(output), strip); + L->dump(&Output(output), strip, listing && verbosity == M_INFO ? 2 : listing ? 1 : 0); return 0; } |