#!/usr/bin/perl

use strict;
use warnings;

use Data::Dumper;
use Ernad::Learn;
use Ernad::Notify;

my $impna = $ARGV[0] // die "no impna";
my $repcode= $ARGV[1] // die "I need a report";
my $notify= $ARGV[2] // '';

my $l=Ernad::Learn->new({'impna' => $impna,
                         'verbose' => 1});

## required for the email software
our $e=$l->{'e'};

my $ps_rif=$l->presort_ahead($repcode) or exit;
if($notify) {
  &Ernad::Notify::notify($e,$ps_rif);
}
