#!/usr/bin/perl -w

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
  if 0;    # not running under some shell

use strict;
use warnings;
use File::Find;
use File::Spec;
use Pod::Usage 1.12;
use Getopt::Long;
use TAP::Parser 0.51;
use TAP::Convert::TET;

Getopt::Long::Configure( 'no_ignore_case', 'bundling' );
GetOptions(
    'v|verbose' => \my $VERBOSE,
    'h|help|?'  => sub { pod2usage( { -verbose => 1 } ); exit },
    'H|man'     => sub { pod2usage( { -verbose => 2 } ); exit },
);

my $converter = TAP::Convert::TET->new( { program => 'tap2tet' } );

$converter->start;
while ( my $file = shift ) {
    open my $tap, '<', $file or die "Can't read $file ($!)\n";
    my $parser = TAP::Parser->new( { source => $tap } );
    $converter->convert( $parser, $file );
    close $tap;
}
$converter->end;

__END__

=head1 NAME

tap2tet - Run tests through a TAP harness.

=head1 USAGE

 tap2tet [options] [files]

=head1 OPTIONS

Boolean options

 -v,  --verbose     Print all test lines.
 -h,  --help        Display this help
 -?,                Display this help
 -H,  --man         Longer manpage for tap2tet
