diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-06-16 22:28:53 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-06-16 22:28:53 +0200 |
commit | ffbf7ca613885ce8093cc4325d04cd14e147ab80 (patch) | |
tree | 8f712aaa60ae9d695b9b660bb07e8970c842e282 /bin | |
parent | 7e3cd10ffba1b29cea5fc48e518884cb0aa67cd2 (diff) |
parse footpaths, print them when efa -E is used
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/efa | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -114,6 +114,29 @@ sub check_for_error { return; } +sub format_footpath { + my @parts = @_; + my $str = q{}; + + for my $path_elem (@parts) { + my ( $type, $level ) = @{$path_elem}; + if ( $level eq 'UP' ) { + $str .= ' ↗'; + } + elsif ( $level eq 'DOWN' ) { + $str .= ' ↘'; + } + elsif ( $level eq 'LEVEL' ) { + $str .= ' →'; + } + else { + $str .= " [unhandled level, please report a bug : $level]"; + } + } + + return $str; +} + sub display_connection { my ($c) = @_; @@ -153,6 +176,14 @@ sub display_connection { printf( "%-5s an %s\n", $c->arrival_time, $c->arrival_stop_and_platform, ); print "\n"; + if ( $opt->{'extended-info'} + and $c->footpath_duration + and $c->footpath_type ne 'IDEST' ) + { + printf( "%5d min Umsteigedauer: %s\n\n", + $c->footpath_duration, format_footpath( $c->footpath_parts ) ); + } + return; } |