summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-11-22 21:22:20 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-11-22 21:22:20 +0100
commit30eff16801a7533ad176cb76cace0ba3aa861336 (patch)
tree0ff7fbcd424d1913635cb0197b5e39fe6be37057 /bin
parent10acec329cce1356b3965a1ae3819711f21e5939 (diff)
Route/Part, efa: Expose via delays
Diffstat (limited to 'bin')
-rwxr-xr-xbin/efa21
1 files changed, 16 insertions, 5 deletions
diff --git a/bin/efa b/bin/efa
index ef4c8d5..7c39ced 100755
--- a/bin/efa
+++ b/bin/efa
@@ -173,7 +173,7 @@ sub format_footpath {
return $str;
}
-sub format_delay {
+sub format_delay_incl {
my ( $delay, $len ) = @_;
if ( $delay and $len ) {
return sprintf( "(%+${len}d)", $delay );
@@ -181,6 +181,14 @@ sub format_delay {
return q{};
}
+sub format_delay_excl {
+ my ( $delay, $len ) = @_;
+ if ( $delay and $len ) {
+ return sprintf( " %+${len}d ", $delay );
+ }
+ return q{};
+}
+
sub display_routes {
my (@routes) = @_;
@@ -269,21 +277,24 @@ sub display_connection {
printf(
"%-5s %-${delay_fmt}s ab %-30s\n",
$c->departure_time,
- format_delay( $c->departure_delay, $delay_len ),
+ format_delay_incl( $c->departure_delay, $delay_len ),
$c->departure_stop_and_platform,
);
if ( $opt->{'full-route'} ) {
for my $via_stop ( $c->via ) {
- printf( "%-5s %-${delay_fmt}s %-30s %s\n",
- $via_stop->[1], q{}, $via_stop->[2], $via_stop->[3] );
+ printf(
+ "%-5s %-${delay_fmt}s %-30s %s\n",
+ $via_stop->[1], format_delay_excl( $via_stop->[4], $delay_len ),
+ $via_stop->[2], $via_stop->[3]
+ );
}
}
printf(
"%-5s %-${delay_fmt}s an %-30s %s\n",
$c->arrival_time,
- format_delay( $c->arrival_delay, $delay_len ),
+ format_delay_incl( $c->arrival_delay, $delay_len ),
$c->arrival_stop_and_platform, $occupancy
);