summaryrefslogtreecommitdiff
path: root/bin/efa-m
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-02-23 22:03:56 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-02-23 22:03:56 +0100
commitbb2ec6920d6ad5aad255f917a4b3fd2c9b588e45 (patch)
tree724c3f1658ee85f7560ebe67185c7aa4ee57b771 /bin/efa-m
parent4ea052dee5be4951189e943f11d16ba5f6c7c334 (diff)
add -o, --offset option
Diffstat (limited to 'bin/efa-m')
-rwxr-xr-xbin/efa-m8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/efa-m b/bin/efa-m
index dc27f22..577c471 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -15,7 +15,7 @@ use List::Util qw(max);
use Travel::Status::DE::EFA;
my $efa_url = 'http://efa.vrr.de/vrr/XSLT_DM_REQUEST';
-my ( $date, $time, $input_type, $list_lines, $relative_times );
+my ( $date, $time, $input_type, $list_lines, $offset, $relative_times );
my ( @grep_lines, @grep_platforms );
@ARGV = map { decode( 'UTF-8', $_ ) } @ARGV;
@@ -25,6 +25,7 @@ GetOptions(
'h|help' => sub { show_help(0) },
'l|line=s@' => \@grep_lines,
'L|linelist' => \$list_lines,
+ 'o|offset=i' => \$offset,
'p|platform=s@' => \@grep_platforms,
'r|relative' => \$relative_times,
't|time=s' => \$time,
@@ -139,6 +140,7 @@ sub show_results {
( @grep_lines and not( $d->line ~~ \@grep_lines ) )
or ( @grep_platforms
and not( $platform ~~ \@grep_platforms ) )
+ or ( $offset and $d->countdown < $offset )
)
{
next;
@@ -222,6 +224,10 @@ using B<--date> and B<--time> are guaranteed to be included.
Only show departures of I<lines> (comma-separatad list, option may be
repeated)
+=item B<-o>, B<--offset> I<minutes>
+
+Ignore departures which are less than I<minutes> from now.
+
=item B<-p>, B<--platform> I<platforms>
Only show departures at I<platforms> (comma-separated list, option may be