chiark / gitweb /
*** empty log message ***
authorjames <james>
Wed, 20 Feb 2008 15:50:14 +0000 (15:50 +0000)
committerjames <james>
Wed, 20 Feb 2008 15:50:14 +0000 (15:50 +0000)
apps/sympathy.c

index 4b67502d5e74f112466ce25426845c31326089f1..e90b8d231376b13662600393a648b4c35e184c48 100644 (file)
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
 
 /*
  * $Log$
+ * Revision 1.5  2008/02/20 15:50:14  james
+ * *** empty log message ***
+ *
  * Revision 1.4  2008/02/20 02:11:35  james
  * *** empty log message ***
  *
@@ -30,52 +33,56 @@ static char rcsid[] = "$Id$";
 int
 main (int argc, char *argv[])
 {
-int c;
-extern char *optarg;
-extern int optind, opterr, optopt;
-
-int tflag=0,cflag=0,sflag=0,rflag=0;
-int lflag=0,dflag=0,bflag=0,pflag=0;
-int kflag=0;
-
-int nhistory=200;
-int baud=-1;
-char *rid,*device_path;
-char *socket_path;
-
-while ((c=getopt(argc,argv,"tscr:d:pb:fL:Fk:n:"))!=EOF) {
-switch(c) {
-       case 't':
-               tflag++;
-               break;
-       case 's':
-               sflag++;
-               break;
-       case 'c':
-               cflag++;
-       
-
-
-
-
-
-
-default:
-       usage();
-}
-}
-
-
-
-
-           "sympathy -t      [-l] [-d serialdev|-p] [-b baud] [-f] [-L log]\n"
-           "sympathy -s      [-l] [-d serialdev|-p] [-b baud] [-f] [-L log] [-F] [-k skt]\n"
-          "                      [-n hlines]\n"
-           "sympathy [-s -c] [-l] [-d serialdev|-p] [-b baud] [-f] [-L log] [-k skt]\n"
-          "                      [-n hlines]\n"
-           "sympathy -c      [-H] -k skt\n"
-           "sympathy -r id   [-H]\n"
-           "\n"
-
-  client ();
+  int c;
+  extern char *optarg;
+  extern int optind, opterr, optopt;
+
+  int tflag = 0, cflag = 0, sflag = 0, rflag = 0;
+  int lflag = 0, dflag = 0, bflag = 0, pflag = 0;
+  int kflag = 0;
+
+  int nhistory = 200;
+  int baud = -1;
+  char *rid, *device_path;
+  char *socket_path;
+
+  Log *log=NULL;
+
+  while ((c = getopt (argc, argv, "tscr:d:pb:fL:Fk:n:")) != EOF)
+    {
+      switch (c)
+        {
+        case 't':
+          tflag++;
+          break;
+        case 's':
+          sflag++;
+          break;
+        case 'c':
+          cflag++;
+       break;
+        case 'r':
+          rflag++;
+         rid=optarg;
+       break;
+       case 'L':
+               if (log) moan("only one -L argument is allowed");
+               log=file_log_new(optarg);
+               if (!log) moan("couldn't open %s as a log file",optarg);
+        default:
+          usage ();
+        }
+    }
+
+
+
+
+#if 0
+  "sympathy -t      [-l] [-d serialdev|-p] [-b baud] [-f] [-L log]\n"
+    "sympathy -s      [-l] [-d serialdev|-p] [-b baud] [-f] [-L log] [-F] [-k skt]\n"
+    "                      [-n hlines]\n"
+    "sympathy [-s -c] [-l] [-d serialdev|-p] [-b baud] [-f] [-L log] [-k skt]\n"
+    "                      [-n hlines]\n"
+    "sympathy -c      [-H] -k skt\n" "sympathy -r id   [-H]\n" "\n" client ();
+#endif
 }