diff options
Diffstat (limited to 'bin/efa-m')
-rwxr-xr-x | bin/efa-m | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -13,7 +13,7 @@ use Getopt::Long qw(:config no_ignore_case); use List::Util qw(max); use Travel::Status::DE::VRR; -my ( $date, $time, $input_type, $list_lines ); +my ( $date, $time, $input_type, $list_lines, $relative_times ); my ( @grep_lines, @grep_platforms ); GetOptions( @@ -22,6 +22,7 @@ GetOptions( 'l|line=s@' => \@grep_lines, 'L|linelist' => \$list_lines, 'p|platform=s@' => \@grep_platforms, + 'r|relative' => \$relative_times, 't|time=s' => \$time, 'V|version' => \&show_version, @@ -121,7 +122,8 @@ sub show_results { for my $d ( $status->results ) { my $platform = $d->platform; - my $dtime = $d->time; + my $dtime = ( + $relative_times ? sprintf( '%2d min', $d->countdown ) : $d->time ); if ( $d->platform_db ) { $platform .= ' (DB)'; @@ -137,14 +139,25 @@ sub show_results { } if ( $d->is_cancelled ) { - $dtime .= ' CANCELED'; + if ($relative_times) { + next; + } + else { + $dtime .= ' CANCELED'; + } } if ( $d->delay ) { $dtime .= ' (+' . $d->delay . ')'; } - push( @output, - [ $dtime, $platform, $d->line, $d->destination, $d->info ] ); + if ($relative_times) { + push( @output, + [ $platform, $d->line, $d->destination, $dtime, $d->info ] ); + } + else { + push( @output, + [ $dtime, $platform, $d->line, $d->destination, $d->info ] ); + } } display_result(@output); @@ -204,9 +217,13 @@ repeated) Only show departures at I<platforms> (comma-separated list, option may be repeated). Note that the C<< Bstg. >> / C<< Gleis >> prefix must be omitted. +=item B<-r>, B<--relative> + +Use relative departure times. + =item B<-t>, B<--time> I<hh:mm> -Show departures starting at I<time> instead of now +Show departures starting at I<time> instead of now. =item B<-V>, B<--version> |