#!/usr/bin/perl
# Time-stamp: <2007-08-26 21:57:51 phm>
BEGIN { $ENV{PATH} = '/bin:/usr/bin:/usr/local/bin';$^W = 0; };
no warnings;
no diagnostics;
binmode STDIN, ':utf8';
binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';
use Encode qw(_utf8_on);

sub usage {
print STDERR <<_EOHELP_
tratext_update

 1. Japanische Zeichenketten in Datei identifizieren und umwandeln
_EOHELP_
}

use A2E::Opts;
my $opts = A2E::Opts->new('vdrhwlin:D:t:');

my $dbnom = $opts->{D} || 'a2e';

my $keyvals = {
    tratext_etcdir => '/usr/local/etc/tratext',
    verbose => $opts->{v} || $ENV{VERBOSE},
    interact => $opts->{i} ||  $ENV{INTERACT},
    debug => $opts->{d} || $ENV{DEBUG},
    table => $opts->{t} || 'jaen',
    reset_reks => $opts->{r}, 
    write_file => $opts->{w},
    nlin_skip => $opts->{n},
    localhost => $opts->{l} || !@ARGV,
    # cjk2asc_names => [ 'cjk2asc', 'cjk2asc_en' ],
};

use A2E::Tratext;
my $tratext = new A2E::Tratext $dbnom, $keyvals;

# printf STDERR "debug mode is %s.\n", $tratext->{debug} ? 'on' : 'off'; 
# printf STDERR "verbose mode is %s.\n", $tratext->{verbose} ? 'on' : 'off'; 
# printf STDERR "interaction mode is %s.\n", $tratext->{interact} ? 'on' : 'off'; 

usage if $opts->{h};

if (@ARGV) {
    $tratext->update(@ARGV);
} else { 
    do { _utf8_on $_;print STDERR $_, "\n" } for "TEST: $0 läuft.", "Erklärungen bekommst du mit -h.";
    exit 0;
};

# Local Variables:
# coding: utf-8
# url: http://a2e.de/adv/tratext/tratext_update.pl
# srcfile:/adv/tratext/tratext_update.pl
# mode: perl
# End:
