added manpage
[ust.git] / ust.1
1 .Dd ust\-VERSION
2 .Dt UST 1
3 .Os
4 .Sh NAME
5 .Nm ust
6 .Nd uncomplicated serial terminal
7 .Sh SYNOPSIS
8 .Nm
9 .Op Fl \-line|\-l Ar line
10 .Op Fl \-speed|\-s Ar # | Ar \-#
11 .Op Fl \-rx\-speed|\-i Ar #
12 .Op Fl \-data\-bits|\-D Ar #
13 .Op Fl \-stop\-bits|\-S
14 .Op Fl \-even|\-e
15 .Op Fl \-odd|\-o
16 .Op Fl \-hardware\-rts\-cts|\-r
17 .Op Fl \-hardware\-dtr\-dsr|\-R
18 .Op Fl \-software|\-X
19 .Op Fl \-delay|\-d Ar #
20 .Op Fl \-min\-chars|\-m Ar #
21 .Op Fl \-canonical|\-c
22 .Op Fl \-echo|\-h
23 .Op Fl \-backspace|\-b
24 .Op Fl \-verbose|\-v
25 .Op Fl \-translation|\-t Ar option
26 .Op Fl \-input\-translation|\-T Ar option
27 .Sh DESCRIPTION
28 .Nm
29 is a simple, highly configurable serial terminal with stdin/stdout redirection support.
30 Unlike other utilities of it's kind,
31 .Nm
32 always has all options set \- even the line (device name).
33 So running ust without any arguments:
34 .Pp
35 .Bd -literal -offset indent
36 $ ust
37 .Ed
38 .Pp
39 Will make it try to open the line specified in
40 .Ar config.h .
41 This way the user might set a default config for a specific device without any additional sh scripts or aliases, or just set a different default for a few options as their preference.
42 .Sh OPTIONS
43 .Bl -tag -width ".Fl \-line|\-l Ar line"
44 .It Fl \-line|\-l Ar line
45 The device name can be input in two formats:
46 .Ar '/dev/cua00'
47 or
48 .Ar `cua00` .
49 .It Fl \-speed|\-s Ar # | Ar \-#
50 Baudrate set by this flag also applies to RX baud if that wasn't explicitly set.
51 .It Fl \-rx\-speed|\-i Ar #
52 Separate baudrate for RX line.
53 .It Fl \-data\-bits|\-D Ar #
54 Data bits, may be set to:
55 .Ar 8 ,
56 .Ar 7 ,
57 .Ar 6
58 or
59 .Ar 5 .
60 .It Fl \-stop\-bits|\-S
61 Two stop bits are set if the flag is toggled on (in case of
62 .Ar 5
63 data bits, it's 1,5, which just means that the line is in marking state for the duration equal to 1,5 times the standard bit period)
64 when toggle is off 1 stop bit is set in every case.
65 .It Fl \-even|\-e
66 Toggle even parity.
67 .It Fl \-odd|\-o
68 Toggle odd parity (toggling both on disables parity entirely).
69 .It Fl \-hardware\-rts\-cts|\-r
70 Toggle RTS/CTS flow control.
71 .It Fl \-hardware\-dtr\-dsr|\-R
72 Toggle DTR/DSR flow control (setting both hardware flow control options will enable DCD flow control).
73 .It Fl \-software|\-X
74 Toggle XON/XOFF software flow control (can be enabled with hardware flow control simultaneously).
75 .It Fl \-delay|\-d Ar #
76 Delay between sending multiple characters (when redirecting stdin or writing a file) to the line in nanoseconds.
77 .It Fl \-min\-chars|\-m Ar #
78 The minimum of characters to input before they get sent to the line.
79 .It Fl \-canonical|\-c
80 Toggle canonical mode (the ability to edit the input locally before sending it to the line).
81 .It Fl \-echo|\-h
82 Toggle local echo (half\-duplex mode).
83 .It Fl \-backspace|\-b
84 Toggle the backspace key character between
85 .Ar \&^H
86 and
87 .Ar \&^? .
88 .It Fl \-verbose|\-v
89 Toggle verbose output printed to stderr.
90 .It Fl \-translation|\-t Ar option
91 Toggle translation options (to the line) for CR and LF, toggling multiple should be done like so:
92 .Fl t Ar no\-cr Fl t Ar no\-lf .
93 .It Fl \-input\-translation|\-T Ar option
94 Toggle translation options (from the line) for CR an LF, the options are:
95 .Pp
96 .Ar cr\-to\-lf
97 .Ar cr\-in\-lf
98 .Ar no\-cr
99 .Ar lf\-to\-cr
100 .Ar lf\-in\-cr
101 .Ar no\-lf
102 .Pp
103 .Sh USAGE
104 If the first character in the input buffer is the special character (tilde by default, can be changed in
105 .Ar config.h )
106 it will be escaped and the next character may run a command.
107 .Bl -tag -width ".Fl \&. No or Ar \&^D"
108 .It Ar \&. No or Ar \&^D
109 Drop the connection and exit.
110 .It Ar s
111 Set new speed (both TX and RX).
112 .It Ar d
113 Set new character delay.
114 .It Ar b
115 Toggle backspace character
116 .It Ar t No | Ar T
117 Toggle a translation option (output|input).
118 .It Ar c
119 Toggle canonical mode
120 .It Ar h
121 Toggle echo.
122 .It Ar w
123 Write a file to the line.
124 .It Ar p
125 Send a DCD pulse.
126 .Sh EXIT STATUS
127 .Pp
128 .Nm
129 exits 2 if some of the user\-set options were invalid and exits 1 on general errors.
130 .Sh EXAMPLES
131 .Ed
132 .Pp
133 Pipe the utility and write output to a file.
134 .Bd -literal -offset indent
135 $ printf "00,78,FFFF\\r45\\r" | ust \-19200 \-d 9000000 > wozmon.out
136 $ cat wozmon.out
137 00,78,FFFF
138
139 00: 54
140 78: CE
141 FFFF: 00
142
143 45
144
145 45: 9A
146
147 .Ed
148 .Pp
149 .Ed
150 .Sh SEE ALSO
151 .Xr stty 1 ,
152 .Xr cu 1 ,
153 .Xr tip 1
154 .Sh BUGS
155 The program is still in development, if you are reading this, know that a lot of functionality does not work or work as expected.