From eb1534ec0924b8ff68e370249af41d14077411ab Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 6 Mar 2012 02:22:24 -0600 Subject: documentation --- bin/ttyrec | 46 +++++++++++++++++++++++++++ lib/App/Ttyrec.pm | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) diff --git a/bin/ttyrec b/bin/ttyrec index 0aefecb..e7a878b 100644 --- a/bin/ttyrec +++ b/bin/ttyrec @@ -7,6 +7,46 @@ use warnings; use App::Ttyrec; use Getopt::Long; +=head1 SYNOPSIS + + ttyrec foo.ttyrec + ttyrec -e 'nethack' nethack.ttyrec + ttyrec -a + +=head1 DESCRIPTION + +This is an implementation of the C program for recording terminal +sessions. All data that the program running in the terminal produces is +recorded, along with timing information, so that it can be replayed later (via +a ttyrec player such as the C script distributed with +C). + +This program is intended to be mostly a drop-in replacement for the C +program distributed L. + +=head1 OPTIONS + + ttyrec [-a] [-e ] [output_file] + +=over 4 + +=item -a + +Append to the ttyrec file, rather than overwriting it. + +=item -e + +Execute , rather than a shell. Defaults to C<$SHELL> or C. + +=item output_file + +The file to write the ttyrec data to. This can be a named pipe. Defaults to +C. + +=back + +=cut + my $cmd = $ENV{SHELL} || '/bin/sh'; my $append; @@ -33,3 +73,9 @@ App::Ttyrec->new( ttyrec_file => ($ARGV[0] || 'ttyrecord'), append => $append, )->run($cmd); + +=head1 SEE ALSO + +L + +=cut diff --git a/lib/App/Ttyrec.pm b/lib/App/Ttyrec.pm index 828556c..35d7141 100644 --- a/lib/App/Ttyrec.pm +++ b/lib/App/Ttyrec.pm @@ -7,18 +7,53 @@ use Tie::Handle::TtyRec 0.04; with 'Term::Filter'; +=head1 SYNOPSIS + + use App::Ttyrec; + + App::Ttyrec->new( + ttyrec_file => 'nethack.ttyrec', + )->run('nethack'); + +=head1 DESCRIPTION + +This module handles setting up and running a terminal session which records its +output to a ttyrec file. These files can then be later read via software such +as L. + +=cut + +=attr ttyrec_file + +The name of the file to write to (which can be a named pipe). Defaults to +C. + +=cut + has ttyrec_file => ( is => 'ro', isa => 'Str', default => 'ttyrecord', ); +=attr append + +Whether or not to append to the ttyrec file. Defaults to false. + +=cut + has append => ( is => 'ro', isa => 'Bool', default => 0, ); +=attr ttyrec + +The L instance used to actually write the ttyrec file. + +=cut + has ttyrec => ( is => 'ro', isa => 'FileHandle', @@ -38,7 +73,67 @@ sub munge_output { $got; } +=method run(@cmd) + +Run the command specified by C<@cmd>, as though via C. The output that +this command writes to the terminal will also be recorded in the file specified +by C. + +=cut + __PACKAGE__->meta->make_immutable; no Moose; +=head1 BUGS + +No known bugs. + +Please report any bugs through RT: email +C, or browse to +L. + +=head1 SEE ALSO + +L + +L + +L + +=head1 SUPPORT + +You can find this documentation for this module with the perldoc command. + + perldoc App::Ttyrec + +You can also look for information at: + +=over 4 + +=item * AnnoCPAN: Annotated CPAN documentation + +L + +=item * CPAN Ratings + +L + +=item * RT: CPAN's request tracker + +L + +=item * Search CPAN + +L + +=back + +=begin Pod::Coverage + +munge_output + +=end Pod::Coverage + +=cut + 1; -- cgit v1.2.3-54-g00ecf