main.cxx

changeset 16
393359908179
parent 11
f08abacb46c9
child 20
d7b13805d1e0
--- a/main.cxx	Sat Jul 14 16:31:21 2012 +0300
+++ b/main.cxx	Sat Jul 14 17:24:21 2012 +0300
@@ -53,19 +53,21 @@
 #include "botcommands.h"
 
 int main (int argc, char** argv) {
+	// Print header
+	str header;
+	str headerline = "-=";
+	header.appendformat ("%s version %d.%d.%d", APPNAME, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
+	headerline.repeat ((header.len()/2)-1);
+	headerline += '-';
+	printf ("%s\n%s\n", header.chars(), headerline.chars());
+	
 	if (argc != 3) {
 		fprintf (stderr, "usage: %s: <infile> <outFile>\n", argv[0]);
 		exit (1);
 	}
 	
-	// Print header
-	str header;
-	str headerline = "=-";
-	header.appendformat ("%s version %d.%d.%d", APPNAME, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
-	headerline.repeat ((header.len()/2)-1);
-	printf ("%s\n%s\n", header.chars(), headerline.chars());
-	
 	// Read definitions
+	printf ("Reading definitions...\n");
 	ReadEvents ();
 	ReadCommands ();
 	
@@ -74,15 +76,17 @@
 	ObjWriter *w = new ObjWriter (argv[2]);
 	
 	// We're set, begin parsing :)
+	printf ("Parsing script..\n");
 	r->BeginParse (w);
 	
-	// Clear out the junk afterwards
+	// Parse done, print statistics
+	printf ("%d states written\n", g_NumStates);
+	printf ("%d events written\n", g_NumEvents);
+	printf ("-- %u bytes written to %s\n", w->numWrittenBytes, argv[2]);
+	
+	// Clear out the junk
 	delete r;
 	delete w;
-	
-	// Print statistics
-	printf ("%d states written\n", g_NumStates);
-	printf ("%d events written\n", g_NumEvents);
 }
 
 void error (const char* text, ...) {

mercurial