summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpixel <pixel>2007-07-27 10:05:52 +0000
committerpixel <pixel>2007-07-27 10:05:52 +0000
commit6c1ab7da376ae7f78a075dda5c5be0dabce20931 (patch)
treebc44e447c450c96140cf6b63c39a37afa8ba61fb /src
parenta68385b1043a2041390f65ce5cf9ed434af5e95d (diff)
Upgrading to Lua-5.1.2
Diffstat (limited to 'src')
-rw-r--r--src/luac.cc11
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;
}