From 6ddf48b7f40ef7ad601c2fac579dc0a9dbad0bf1 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 4 Jun 2015 16:44:38 +0200 Subject: full-route: improve output --- bin/efa-m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/efa-m b/bin/efa-m index 3956bdb..3960c69 100755 --- a/bin/efa-m +++ b/bin/efa-m @@ -91,10 +91,18 @@ sub format_route { say "BUG"; next; } - if ( $stop->{arr_time} eq $stop->{dep_time} ) { + if ( not defined $stop->{arr_time} ) { $output .= sprintf( " %5s %40s %s\n", $stop->{dep_time}, $stop->{stop}, $stop->{platform}, ); } + elsif (not defined $stop->{dep_time}) { + $output .= sprintf( "%5s %40s %s\n", + $stop->{arr_time}, $stop->{stop}, $stop->{platform}, ); + } + elsif ( $stop->{arr_time} eq $stop->{dep_time} ) { + $output .= sprintf( " %5s %40s %s\n", + $stop->{dep_time}, $stop->{stop}, $stop->{platform}, ); + } else { $output .= sprintf( "%5s → %5s %40s %s\n", -- cgit v1.2.3