diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-22 21:38:07 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-22 21:38:07 +0100 |
commit | 40e6e7e5cc4dbc8d23389a86fdd042ac9230060b (patch) | |
tree | 1d1488f1c32a684084bd6c5ca676ddf32fc306b1 /bin | |
parent | 75715047725355884ad04e97aeeff96bacb72c63 (diff) |
hafas: add -f/--full-route option (Section: pass date to Journey for ->route)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/hafas | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -19,6 +19,7 @@ my ( $date, $time, $language ); my $types = q{}; my $developer_mode; my $json_output; +my $show_full_route; my ( $list_services, $service ); my ( @excluded_mots, @exclusive_mots ); my $verbosity = 0; @@ -45,6 +46,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{}; GetOptions( 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, + 'f|full-route' => \$show_full_route, 'l|language=s' => \$language, 'm|mot=s' => \$types, 's|service=s' => \$service, @@ -364,6 +366,22 @@ for my $res ( $hafas->connections ) { $sec->dep_platform ? q{: } : q{}, $sec->dep_platform // q{}, ); + 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 an %s%s%s\n", $sec->arr_cancelled |