summaryrefslogtreecommitdiff
path: root/bin/hafas
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-11-25 15:12:30 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-11-25 15:12:30 +0100
commit288f1a74ec940e3fc6494b4ba37b3d71924e4eb3 (patch)
tree53737fc25bbdfc05a6ebae71204d2ecf7e3dfa4d /bin/hafas
parentb49061d7199efe34d5018302f0abbe5ea9ff1362 (diff)
hafas -f: Show load at all intermediate stops
Diffstat (limited to 'bin/hafas')
-rwxr-xr-xbin/hafas65
1 files changed, 32 insertions, 33 deletions
diff --git a/bin/hafas b/bin/hafas
index 3434aa7..ab8e97b 100755
--- a/bin/hafas
+++ b/bin/hafas
@@ -354,44 +354,43 @@ for my $res ( $hafas->connections ) {
"${output_bold}%s${output_reset} → %s %s\n",
$sec->journey->name,
$sec->journey->direction,
- display_occupancies( $sec->load )
- );
- printf(
- "%-5s %-${delay_fmt}s ab %s%s%s\n",
- $sec->dep_cancelled
- ? '--:--'
- : $sec->dep->strftime('%H:%M'),
- format_delay( $sec->dep_delay, $delay_len ),
- $sec->dep_loc->name,
- $sec->dep_platform ? q{: } : q{},
- $sec->dep_platform // q{},
+ $show_full_route ? q{} : display_occupancies( $sec->load ),
);
if ($show_full_route) {
for my $stop ( $sec->journey->route ) {
- if ( $stop->loc != $sec->dep_loc
- and $stop->loc != $sec->arr_loc )
- {
- printf(
- "%-5s %-${delay_fmt}s %s%s%s\n",
- $stop->arr ? $stop->arr->strftime('%H:%M') : q{},
- format_delay( $stop->arr_delay, $delay_len ),
- $stop->loc->name,
- $stop->platform ? q{: } : q{},
- $stop->platform // q{},
- );
- }
+ printf(
+ "%-5s %-${delay_fmt}s %s %s%s%s\n",
+ $stop->arr ? $stop->arr->strftime('%H:%M') : q{},
+ format_delay( $stop->arr_delay, $delay_len ),
+ display_occupancies( $stop->load ),
+ $stop->loc->name,
+ $stop->platform ? q{: } : q{},
+ $stop->platform // q{},
+ );
}
}
- printf(
- "%-5s %-${delay_fmt}s an %s%s%s\n",
- $sec->arr_cancelled
- ? '--:--'
- : $sec->arr->strftime('%H:%M'),
- format_delay( $sec->arr_delay, $delay_len ),
- $sec->arr_loc->name,
- $sec->arr_platform ? q{: } : q{},
- $sec->arr_platform // q{},
- );
+ else {
+ printf(
+ "%-5s %-${delay_fmt}s ab %s%s%s\n",
+ $sec->dep_cancelled
+ ? '--:--'
+ : $sec->dep->strftime('%H:%M'),
+ format_delay( $sec->dep_delay, $delay_len ),
+ $sec->dep_loc->name,
+ $sec->dep_platform ? q{: } : q{},
+ $sec->dep_platform // q{},
+ );
+ printf(
+ "%-5s %-${delay_fmt}s an %s%s%s\n",
+ $sec->arr_cancelled
+ ? '--:--'
+ : $sec->arr->strftime('%H:%M'),
+ format_delay( $sec->arr_delay, $delay_len ),
+ $sec->arr_loc->name,
+ $sec->arr_platform ? q{: } : q{},
+ $sec->arr_platform // q{},
+ );
+ }
}
elsif ( $sec->type eq 'WALK' ) {
printf(