summaryrefslogtreecommitdiff
path: root/bin/efa-m
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-26 15:51:20 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-26 15:51:20 +0200
commit43a52169cfec80d171a810796c4eef0bd48cf6d0 (patch)
tree6420887893b9a06f9c817acd96f6ae3877167b2d /bin/efa-m
parent4a7eca2e34be18214cfeefa3962487ed521bca20 (diff)
add proper -Of / -Oa / -Ob support
Diffstat (limited to 'bin/efa-m')
-rwxr-xr-xbin/efa-m21
1 files changed, 16 insertions, 5 deletions
diff --git a/bin/efa-m b/bin/efa-m
index 54045b6..5493b85 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -11,7 +11,7 @@ our $VERSION = '1.10';
binmode( STDOUT, ':encoding(utf-8)' );
use Encode qw(decode);
-use Getopt::Long qw(:config no_ignore_case);
+use Getopt::Long qw(:config no_ignore_case bundling);
use List::Util qw(first max);
use Travel::Status::DE::EFA;
@@ -61,9 +61,11 @@ if ( $input =~ s{ ^ (?<type> address|poi|stop) : }{}x ) {
for my $efield (@edata_pre) {
given ($efield) {
- when ('f') { $edata{fullroute} = 1; $full_routes = 1 }
- when ('r') { $edata{route} = 1; $full_routes = 1 }
- default { $edata{$efield} = 1 }
+ when ('a') { $edata{route_after} = 1; $full_routes = 1 }
+ when ('b') { $edata{route_before} = 1; $full_routes = 1 }
+ when ('f') { $edata{fullroute} = 1; $full_routes = 1 }
+ when ('r') { $edata{route} = 1; $full_routes = 1 }
+ default { $edata{$efield} = 1 }
}
}
if ($filter_via) {
@@ -159,7 +161,7 @@ sub display_result {
@{$line}[ 0 .. 4 ]
);
- if ( $line->[6] and $edata{fullroute} ) {
+ if ( $line->[6] ) {
say $line->[6];
}
}
@@ -237,8 +239,17 @@ sub show_results {
}
if ( $edata{fullroute} ) {
+ $output_line[6]
+ = format_route( $d->route_pre )
+ . ' -' x 30 . "\n"
+ . format_route( $d->route_post );
+ }
+ elsif ( $edata{route_after} ) {
$output_line[6] = format_route( $d->route_post );
}
+ elsif ( $edata{route_before} ) {
+ $output_line[6] = format_route( reverse $d->route_pre );
+ }
push( @output, \@output_line );
}