#!/usr/bin/perl -w

use strict;
use warnings;

use Getopt::Long;
use Pod::Usage;
use DistroMap;

my $verbose=0;
my $help=0;
my $column=1;

my $result = GetOptions (
    @DistroMap::LONGOPT,
    "help"  => \$help,
    'quiet'=> sub {$verbose=0},
    "verbose+"  => \$verbose,
);

if ($help) {
    &DistroMap::longopt_usage();
    pod2usage();
}

my $distromap=DistroMap->new();

while (<>) {
    chomp;
    next unless $_; # empty line ?
    s/^(\s*)//;
    print $1;
    while (s/^(\S+)(\s*)//) {
	my $name=$1;
	my $space=$2;
	my @map=$distromap->multimap_binary_origin2dest($name);
	print join (' ',scalar @map ? @map : $name) , $space;
    }
    print "\n";
}

=head1	NAME

distromap-filter-translate-binary-names - 

=head1	SYNOPSIS

B<distromap-filter-translate-binary-names>
[B<-h|--help>]
[B<-q|--quiet>]
[B<-v|--verbose>]
[<other DistroMap specific options, see --help>]

=head1	DESCRIPTION

B<distromap-filter-translate-binary-names> 

=head1	OPTIONS

=over

=item	B<-h, --help>

Display DistroMap specific options, display this help and exit.

=item	B<-v, --verbose>, B<-q, --quiet>

Verbosity level. Multiple -v increase the verbosity level, -q sets it to 0.

=back

=head1	AUTHOR

Written by Igor Vlasenko <viy@altlinux.org>.

=head1	COPYING

Copyright (c) 2009 Igor Vlasenko, ALT Linux Team.

This is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.

=cut
