main.cxx

changeset 21
ae602e667879
parent 20
d7b13805d1e0
child 22
b48e10ca8832
equal deleted inserted replaced
20:d7b13805d1e0 21:ae602e667879
52 52
53 #include "bots.h" 53 #include "bots.h"
54 #include "botcommands.h" 54 #include "botcommands.h"
55 55
56 int main (int argc, char** argv) { 56 int main (int argc, char** argv) {
57 // Intepret command-line parameters:
58 // -l: list commands
59 if (argc == 2 && !strcmp (argv[1], "-l")) {
60 ReadCommands ();
61 printf ("Begin list of commands:\n");
62 printf ("------------------------------------------------------\n");
63
64 CommandDef* comm;
65 ITERATE_COMMANDS (comm)
66 printf ("%s\n", GetCommandPrototype (comm).chars());
67
68 printf ("------------------------------------------------------\n");
69 printf ("End of command list\n");
70 exit (0);
71 }
72
57 // Print header 73 // Print header
58 str header; 74 str header;
59 str headerline = "-="; 75 str headerline = "-=";
60 header.appendformat ("%s version %d.%d.%d", APPNAME, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION); 76 header.appendformat ("%s version %d.%d.%d", APPNAME, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
61 headerline.repeat ((header.len()/2)-1); 77 headerline.repeat ((header.len()/2)-1);
71 printf ("Reading definitions...\n"); 87 printf ("Reading definitions...\n");
72 ReadEvents (); 88 ReadEvents ();
73 ReadCommands (); 89 ReadCommands ();
74 90
75 // Init string table 91 // Init string table
76 g_StringTable = new StringTable(); 92 InitStringTable();
77 93
78 // Prepare reader and writer 94 // Prepare reader and writer
79 ScriptReader *r = new ScriptReader (argv[1]); 95 ScriptReader *r = new ScriptReader (argv[1]);
80 ObjWriter *w = new ObjWriter (argv[2]); 96 ObjWriter *w = new ObjWriter (argv[2]);
81 97

mercurial