-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmv2.6.in
194 lines (171 loc) · 4.58 KB
/
tmv2.6.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
.\" MIT License
.\"
.\" Copyright (c) 2020 Jude Melton-Houghton
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
.\" of this software and associated documentation files (the "Software"), to
.\" deal in the Software without restriction, including without limitation the
.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
.\" sell copies of the Software, and to permit persons to whom the Software is
.\" furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
.\" IN THE SOFTWARE.
.\"
.TH tmv2 6 "26 Dec. 2020" "version @@VERSION@@"
.SH NAME
.B tmv2
\- Play ASCII-art movies in a terminal window
.SH SYNOPSIS
.B tmv2
.RI [ options ]
[--]
.RI [ input-file ]
.SH DESCRIPTION
.B tmv2
reads a movie and plays the frames one-by-one. If
.I input-file
is not given or is '\-', stdin is read from to show the movie. Otherwise, the
movie is read from the named file. Only one
.I input-file
can be given, at most.
.P
See the
.B EXAMPLE
section for a usage example.
.P
See the
.B DETAILED DESCRIPTION
section for parsing/displaying specification of sorts.
.SH OPTIONS
.IP "-d delay"
Delay a minimum of
.I delay
milliseconds between frames. The program may wait longer if it takes too long to
read or write a frame. Keep in mind that some terminals require a pause after
printing a control sequence. The default delay is 100 milliseconds. The maximum
delay is a very large number of milliseconds.
.IP -l
Loop the animation until interrupted. This requires that the input file be
seekable. (This usually excludes stdin as an input source.)
.IP -L
Stop animating after the last frame. This is the default.
.IP -h
Print help information and exit.
.IP -v
Print version information and exit.
.SH EXAMPLE
.P
Consider a file 'countdown.tmv' containing this text:
.P
~
.br
\ \ \ \ 5
.br
-_-
.br
~
.br
\ \ \ \ 4
.br
-_-
.br
~
.br
\ \ \ \ 3
.br
-_-
.br
~
.br
\ \ \ \ 2
.br
-_-
.br
~
.br
\ \ \ \ 1
.br
-_-
.br
~
.br
_\ _\ 0
.br
0_0
.P
Each frame is introduced by a '~' line. This could be any other text, as
.B tmv2
uses whatever the first line is to separate frames. The command 'tmv2 -d1000
countdown.tmv' would play this animation nicely.
.SH "DETAILED DESCRIPTION"
The input is a series of octets encoding ASCII. It is parsed as a series of
lines. A line has two forms. The first form is zero or more
.I content octets
followed by a line feed octet. The second for is one or more
.I content octets
followed by the end of the input. In both cases, the
.I content octets
are a sequence of octets not containing a line feed octet.
.P
As a special case, if the input contains zero octets, it has one line whose
.I content octets
form a sequence of length zero.
.P
The first line of input is the
.IR "frame separator" .
All the lines, including the first, are parsed as a series of one or more
.IR frames .
A
.I frame
of input consists of one line for which the
.I content octets
match exactly those of the
.IR "frame separator" ,
followed by zero or more
.IR "content lines" .
Each line of the sequence of
.I content lines
satisfies the condition that its
.I content octets
do not match the
.I content octets
of the
.IR "frame separator" .
.P
The sequence of
.I frames
is displayed on the terminal one-by-one with some amount of delay between
displays. To display a
.IR frame ,
each of its
.I content lines
is written verbatim to the terminal in sequence. Before writing the first line,
the output cursor is moved to the left edge of the terminal. Between writing two
adjacent lines of the
.IR frame ,
the output cursor is moved down one cell and to the left edge of the terminal.
Between writing two adjacent
.IR frames ,
the cursor moves to the left edge and up a number of cells, erasing each
terminal line it moves onto in the process. The number of cells is equal to the
number of
.I content lines
in the prior
.IR frame .
.SH EXIT STATUS
On success,
.B tmv2
exits with status 0. If a fatal error occurs,
.B tmv2
exits with a nonzero status.
.SH AUTHOR
Written by Jude Melton-Houghton <jwmhjwmh@gmail.com>.