3 #=======================================================================
5 # File ID: cda34a16-f743-11dd-bcdb-000475e441b9
6 # Replays files with timing information created by script(1)
9 # ©opyleft 2008– Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later, see end of
11 # file for legal stuff.
12 #=======================================================================
33 $progname =~ s/^.*\/(.*?)$/$1/;
34 our $VERSION = "0.00";
36 Getopt
::Long
::Configure
("bundling");
39 "debug" => \
$Opt{'debug'},
40 "help|h" => \
$Opt{'help'},
41 "speed|s=f" => \
$Opt{'speed'},
42 "verbose|v+" => \
$Opt{'verbose'},
43 "version" => \
$Opt{'version'},
45 ) || die("$progname: Option error. Use -h for help.\n");
47 $Opt{'debug'} && ($Debug = 1);
48 $Opt{'help'} && usage
(0);
49 if ($Opt{'version'}) {
57 $fname =~ s/(^.*)\.(scrlog|timing)/$1/;
59 system("scriptreplay", "-m", "0.5", "$fname.timing", "$fname.scrlog", $Opt{'speed'});
64 # Print program version {{{
65 print("$progname v$VERSION\n");
70 # Send the help message to stdout {{{
73 if ($Opt{'verbose'}) {
79 Usage: $progname [options] [file [files [...]]]
81 Replay log files with timing information created by script(1). Expecting
82 .scrlog and .timing extensions.
89 Replay files at speed x. 1 = normal, 2 = double, 0.5 = half, etc.
91 Increase level of verbosity. Can be repeated.
93 Print version information.
95 Print debugging messages.
103 # Print a status message to stderr based on verbosity level {{{
104 my ($verbose_level, $Txt) = @_;
106 if ($Opt{'verbose'} >= $verbose_level) {
107 print(STDERR
"$progname: $Txt\n");
113 # Print a debugging message {{{
115 my @call_info = caller;
116 chomp(my $Txt = shift);
117 my $File = $call_info[1];
119 $File =~ s
#^.*/(.*?)$#$1#;
120 print(STDERR
"$File:$call_info[2] $$ $Txt\n");
127 # Plain Old Documentation (POD) {{{
137 [options] [file [files [...]]]
147 =item B<-h>, B<--help>
149 Print a brief help summary.
151 =item B<-v>, B<--verbose>
153 Increase level of verbosity. Can be repeated.
157 Print version information.
161 Print debugging messages.
171 Made by Øyvind A. Holm S<E<lt>sunny@sunbase.orgE<gt>>.
175 Copyleft © Øyvind A. Holm E<lt>sunny@sunbase.orgE<gt>
176 This is free software; see the file F<COPYING> for legalese stuff.
180 This program is free software: you can redistribute it and/or modify it
181 under the terms of the GNU General Public License as published by the
182 Free Software Foundation, either version 2 of the License, or (at your
183 option) any later version.
185 This program is distributed in the hope that it will be useful, but
186 WITHOUT ANY WARRANTY; without even the implied warranty of
187 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
188 See the GNU General Public License for more details.
190 You should have received a copy of the GNU General Public License along
192 If not, see L<http://www.gnu.org/licenses/>.
200 # vim: set fenc=UTF-8 ft=perl fdm=marker ts=4 sw=4 sts=4 et fo+=w :