chiark / gitweb /
serialmgr: Copy from woking.cam.xci-test.com
[sympathy.git] / apps / usage.c
1 /* 
2  * usage.c:
3  *
4  * Copyright (c) 2008 James McKenzie <sympathy@madingley.org>,
5  * All rights reserved.
6  *
7  */
8
9 static char rcsid[] =
10   "$Id: usage.c,v 1.28 2011/02/28 18:11:10 james Exp $";
11
12 /* 
13  * $Log: usage.c,v $
14  * Revision 1.28  2011/02/28 18:11:10  james
15  * *** empty log message ***
16  *
17  * Revision 1.27  2008/05/09 12:35:57  james
18  * *** empty log message ***
19  *
20  * Revision 1.26  2008/05/09 12:26:58  staffcvs
21  * *** empty log message ***
22  *
23  * Revision 1.25  2008/05/09 12:19:18  james
24  * *** empty log message ***
25  *
26  * Revision 1.24  2008/03/12 01:30:23  james
27  * *** empty log message ***
28  *
29  * Revision 1.23  2008/03/12 01:26:56  james
30  * *** empty log message ***
31  *
32  * Revision 1.22  2008/03/07 13:16:02  james
33  * *** empty log message ***
34  *
35  * Revision 1.21  2008/03/06 21:34:09  james
36  * *** empty log message ***
37  *
38  * Revision 1.20  2008/03/06 17:21:41  james
39  * *** empty log message ***
40  *
41  * Revision 1.19  2008/03/03 06:04:42  james
42  * *** empty log message ***
43  *
44  * Revision 1.18  2008/03/03 06:04:18  james
45  * *** empty log message ***
46  *
47  * Revision 1.17  2008/02/28 16:57:51  james
48  * *** empty log message ***
49  *
50  * Revision 1.16  2008/02/27 18:29:49  james
51  * *** empty log message ***
52  *
53  * Revision 1.15  2008/02/27 16:01:24  james
54  * *** empty log message ***
55  *
56  * Revision 1.14  2008/02/27 09:55:57  james
57  * *** empty log message ***
58  *
59  * Revision 1.13  2008/02/27 09:42:53  james
60  * *** empty log message ***
61  *
62  * Revision 1.12  2008/02/27 09:42:21  james
63  * *** empty log message ***
64  *
65  * Revision 1.11  2008/02/27 01:31:38  james
66  * *** empty log message ***
67  *
68  * Revision 1.10  2008/02/27 01:31:14  james
69  * *** empty log message ***
70  *
71  * Revision 1.9  2008/02/24 00:43:55  james
72  * *** empty log message ***
73  *
74  * Revision 1.8  2008/02/24 00:42:53  james
75  * *** empty log message ***
76  *
77  * Revision 1.7  2008/02/23 11:48:52  james
78  * *** empty log message ***
79  *
80  * Revision 1.6  2008/02/20 18:49:11  staffcvs
81  * *** empty log message ***
82  *
83  * Revision 1.5  2008/02/20 18:31:44  james
84  * *** empty log message ***
85  *
86  * Revision 1.4  2008/02/20 17:18:33  james
87  * *** empty log message ***
88  *
89  * Revision 1.3  2008/02/20 02:11:35  james
90  * *** empty log message ***
91  *
92  * Revision 1.2  2008/02/16 10:58:52  james
93  * *** empty log message ***
94  *
95  * Revision 1.1  2008/02/16 01:30:56  james
96  * *** empty log message ***
97  *
98  */
99
100 #include <stdio.h>
101 #include <stdlib.h>
102
103 void
104 usage (void)
105 {
106
107   fprintf (stderr, "Usage:\n"
108            "sympathy -t      [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-w WxH]\n"
109            "                      [-F] [-P pidfile] [-u] [-N]\n"
110            "                      [pty program] [pty program args]\n"
111            "sympathy -s      [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-w WxH]\n"
112            "                      [-F] [-P pidfile]           [-n hlines] [-k skt]\n"
113            "                      [-S] [pty program] [pty program args]\n"
114            "sympathy [-s -c] [-K] [-d serialdev|-p] [-b baud] [-f] [-L log] [-w WxH]\n"
115            "                      [-F] [-P pidfile] [-u] [-N] [-n hlines] [-k skt]\n"
116            "                      [-S] [pty program] [pty program args]\n"
117            "sympathy -c      [-H] [-I string ]      [-u] [-N]              -k skt\n"
118            "sympathy -r id   [-H] [-I string ]      [-u] [-N]\n"
119            "sympathy -C            -d serialdev\n"
120            "sympathy {-l|-ls}\n"
121            "sympathy -v\n"
122            "sympathy -h\n"
123            "\n"
124            "Main mode:\n"
125            "   -t  terminal emulator mode: one process is started which reads from\n"
126            "          the serial device or ptty and writes to the user's terminal.\n"
127            "   -s  server mode: a process is started (and daemonized unless -F is\n"
128            "          given) which listens on a socket, and reads from the serial\n"
129            "          device or ptty.\n"
130            "   -s -c  server and client mode: Fork a server and connect a client\n"
131            "            incompatible with -F. This is the default mode\n"
132            "   -c     client mode: connect to server mode process\n"
133            "   -r id  client mode: connect to server mode process on socket\n"
134            "             ~/.sympathy/id or ~/.sympathy/hostname.id if id is an\n"
135            "             integer\n"
136            "   -l or -ls  list active sockets in ~/.sympathy\n"
137            "   -C   clear inactive locks\n"
138            "   -v   show version\n"
139            "   -h   show help\n"
140            "\n"
141            "Options:\n"
142            "   -K  lock the serial device. By default sympathy checks that no\n"
143            "          other process has created a lock file, and temporarily ceases\n"
144            "          to access the serial port if it spots one. With this option\n"
145            "          sympathy creates a lock file and prevents other programs\n"
146            "          accessing the serial port. Incompatible with -p\n"
147            "   -d serialdev  the serial device to connect to, eg /dev/ttyS0\n"
148            "   -p   fork a login shell in a ptty and connect to that rather than\n"
149            "           connect to a serial port. This option is the default if\n"
150            "           no -d option is specified\n"
151            "   -b baud  the baudrate to set. If omitted sympathy does not set\n"
152            "              a baudrate and uses the current setting\n"
153            "   -f  set RTS/CTS flowcontrol. By default sympathy disables flow\n"
154            "         control\n"
155            "   -k socket  explicity set the name of the socket, by default\n"
156            "                sympathy will use ~/.sympathy/$pid\n"
157            "   -F  do not detach, run the server in the foreground\n"
158            "   -H  instead of connecting the user's terminal to the session\n"
159            "         emit HTML of the current state of the screen on stdout\n"
160            "   -L log  log activity on the device to the file log\n"
161            "   -n nlines  the number of lines of history to store in the\n"
162            "                 server, that are replayed on connexion\n"
163            "   -P pidfile  write the pid of the server/terminal process to pidfile\n"
164            "   -R  rotate logile specified with -L option\n"
165            "   -S  log errors to syslog\n"
166            "   -u  don't emit utf-8 try to use ISO-2202 to the local terminal\n"
167            "   -w W[xH]  start session with a screen of size W by H. 0<W<=132,\n"
168            "             0<H<24, default 80 by 24\n"
169            "   -N  provide dumb terminal emulation on stdin/stdout instead of\n"
170            "              redering the display, for use with expect(1)\n"
171            "   -I string  inject string into terminal then quit (see man page\n"
172            "                    for escapes\n"
173            "   -B  log the raw data to the log file, rather than running it\n"
174            "         thru the parity error, unicode, and vt102 parsers\n" );
175
176   exit (1);
177 }