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); |