Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18982/src

Modified Files:
	main.c 
Log Message:
main.c: Added new startup option, -L, to log to an automatically generated logfile that is datestamped.

Index: main.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- main.c	19 Jun 2006 04:46:03 -0000	1.9
+++ main.c	10 Aug 2006 10:59:15 -0000	1.10
@@ -46,6 +46,7 @@
     LineToConsole (" [-f filename]       record game into 'filename'\n");
 #endif
     LineToConsole (" [-l filename]       record messages into 'filename'\n");
+    LineToConsole (" [-L]                record messages into autogenerated log file with filename YYYYMMDD.log\n");
 
     LineToConsole (" [-A]   character password\n");
     LineToConsole (" [-C]   character name\n");
@@ -89,6 +90,8 @@
     int hideConsole = 1;
     char *name, *ptr;
     int i;
+    time_t tm;
+    char s[20];
 
 #ifdef GATEWAY
     int hset = 0;
@@ -184,6 +187,12 @@
                     usage++;
                 break;
 
+            case 'L':           /* log to autogenerated file */
+                tm = time(NULL);
+                strftime(s, 20, "%Y%m%d.log", localtime(&tm));
+                logFileName = s;
+                break;
+
             case 'p':           /* port to connect to */
                 if (i < argc && argv[i + 1])
                 {