aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/sympathy.c103
1 files changed, 55 insertions, 48 deletions
diff --git a/apps/sympathy.c b/apps/sympathy.c
index 4b67502..e90b8d2 100644
--- a/apps/sympathy.c
+++ b/apps/sympathy.c
@@ -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
}