#!/usr/bin/env perl use strict; use warnings; # ABSTRACT: record interactive terminal sessions # PODNAME: ttyrec use App::Ttyrec; use Getopt::Long; my $cmd = $ENV{SHELL} || '/bin/sh'; my $append; sub usage { my ($exit) = @_; my $out = $exit ? \*STDERR : \*STDOUT; print { $out } "$0 [-a] [-e ] [output_file]\n"; exit($exit); } GetOptions( 'execute=s' => \$cmd, 'append' => \$append, 'uudecode' => sub { die "uudecode mode not supported. " . "Why are you not just using scp?\n" }, 'help' => sub { usage(0) }, ) || usage(1); App::Ttyrec->new( ttyrec_file => ($ARGV[0] || 'ttyrecord'), append => $append, )->run($cmd);