diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-09-25 21:29:00 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-09-25 21:29:00 +0200 |
commit | 385b25b93a3f10a4044df9fc73027b8ae70dbc8a (patch) | |
tree | 60f95792aefe21c97766dfc0fafd0f7715fc2078 /bin | |
parent | 28ba9a1b23beb2121ff1b57d6139be70a3d808b4 (diff) |
add primitive stopseq output
TODO: Proper classes, locality/parent handling, et cetera
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/efa-m | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -258,6 +258,26 @@ sub display_result { return; } +sub show_stopseq { + my $trip = $efa->result; + + printf( "%s %s → %s\n", + $trip->line, $trip->number // q{}, + $trip->dest_name ); + + for my $stop ( $trip->route ) { + printf( "%s → %s %s\n", + $stop->{sched_arr} + ? ( $stop->{rt_arr} // $stop->{sched_arr} )->strftime('%H:%M') + : q{ }, + $stop->{sched_dep} + ? ( $stop->{rt_dep} // $stop->{sched_dep} )->strftime('%H:%M') + : q{ }, + $stop->{name_full}, + ); + } +} + sub show_lines { my @output; @@ -449,7 +469,10 @@ if ( my $err = $efa->errstr ) { exit 2; } -if ($list_lines) { +if ($stopseq) { + show_stopseq(); +} +elsif ($list_lines) { show_lines(); } else { |