From 042edb977fb7d5827af3bce844a8c00bd1442bcb Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 19 Jan 2025 07:54:23 +0100 Subject: add support for walk segments --- bin/dbris | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin/dbris') diff --git a/bin/dbris b/bin/dbris index d5a4f82..24b5203 100755 --- a/bin/dbris +++ b/bin/dbris @@ -220,6 +220,10 @@ for my $connection ( $ris->connections ) { elsif ( $segment->is_transfer ) { $header .= sprintf( ' %.1fkm', $segment->distance_m / 1e3 ); } + elsif ( $segment->is_walk ) { + + # not shown in header + } else { $header .= q{ ??}; } @@ -244,6 +248,12 @@ for my $connection ( $ris->connections ) { say $note; } } + elsif ( $segment->is_walk ) { + printf( "${output_bold}%s${output_reset} %dm (≈ %d min.)\n", + $segment->walk_name, $segment->distance_m, + $segment->duration->in_units('minutes') ); + next; + } elsif ( $segment->direction ) { printf( "${output_bold}%s${output_reset} → %s %s\n", $segment->train_mid, $segment->direction, @@ -252,6 +262,7 @@ for my $connection ( $ris->connections ) { else { printf( "${output_bold}%s${output_reset}\n", $segment->train_long ); } + printf( "%s ab %s\n", $segment->dep->strftime('%H:%M'), $segment->dep_name ); -- cgit v1.2.3