Calling cfmakeraw disables terminal special character handling. For
example, Ctrl-C does not send SIGINT to scriptreplay. The following
fixes this.
tattr.c_lflag |= ISIG;
where tattr is the struct termios with which we are working.
Now the code is duplicate on many places, but all we usually need is to
remember child status. It seems good enough to have very simple
callback child_die() to inform application about a change.
The patch also add PID to all signal related callbacks.
Signed-off-by: Karel Zak <kzak@redhat.com>
Add alias to -t,--timing to make it easy to copy and past script(1)
comnand line to scriptlive(1) and scriptreplay(1) command lines.
For example:
record:
$ script --log-timing tm --log-in in
print:
$ scriptreplay --log-timing tm --log-in in
re-run:
$ scriptlive --log-timing tm --log-in in
And command line is still the same.
Signed-off-by: Karel Zak <kzak@redhat.com>
* use timeval rather than double for delay
* use sys/time.h macros for wirk with timeval
* add delay normalization to script-playutils.c API
Signed-off-by: Karel Zak <kzak@redhat.com>
The stdin log does not contain line breaks as command line uses CR
between commands. This makes scriptreplay for stdin very
user-unfriendly, because it overwrites still the same line.
The new option --cr-mode provides opportunity to control this
behavior. The default for stdin logs is replace CR with line-break.
Signed-off-by: Karel Zak <kzak@redhat.com>
* add internal support for multiple log files
* add support for new timing file format (default is old format)
Signed-off-by: Karel Zak <kzak@redhat.com>
changed in include/c.h and applied via sed:
sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c")
sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c")
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Now we are always using the same text also for commands
which had still hardcoded descriptions or where we can't
use the standard print_usage_help_options macro.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This patch is trivial and changes nothing, because
we were always using usage(stdout)
Now all our usage() functions look very similar. If wanted we
could auto-generate another big cosmetical patch to remove all
the useless "FILE *out" constants and use printf and puts
rather than their f* friends. Such patch could be automatically
synchronized with the translation project (newlines!) to not
make the translators sick.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Use human numbering for lines - that is start counting from 1. And tell in
error message what the number means.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This adds a concise description of a tool to its usage text.
A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Translating these text elements should happen only once, which is
more likely when the text macros are used properly.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This option caps the delay between updates, to avoid long pauses in
transcript playback.
Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
scriptreplay.c:210:3: warning: format '%zd' expects argument of type 'signed size_t *', but argument 4 has type 'size_t *' [-Wformat]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>