#!/usr/bin/perl

use strict;
use warnings;

use Carp qw(cluck longmess shortmess croak confess);
use Ernad::Erimp;
use Ernad::Store;

my $arg=$ARGV[0];
if(not defined($arg)) {
  die "I need the impna or a directory";
}

my $dir;
if(not -d $arg) {
  my $impna=$arg;
  my $e=Ernad::Erimp->new({'impna'=>$impna,
                           'no_reports'=>1});
  if(not $e) {
    die "You gave me an invalid impna $impna\n";
  }
  $dir=$e->{'dir'}->{'learn'};
}
else {
  $dir=$arg;
}

&Ernad::Store::write_text_dumps_in_dir($dir);

