From bb2ec6920d6ad5aad255f917a4b3fd2c9b588e45 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 23 Feb 2014 22:03:56 +0100 Subject: add -o, --offset option --- Changelog | 4 ++++ bin/efa-m | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 9b25683..7a006f1 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +git HEAD + + * efa-m: Add -o, --offset option + Travel::Status::DE::VRR 1.07 - Tue Jan 07 2014 * efa-m: Add previously undocumented -L option to manual 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 (comma-separatad list, option may be repeated) +=item B<-o>, B<--offset> I + +Ignore departures which are less than I from now. + =item B<-p>, B<--platform> I Only show departures at I (comma-separated list, option may be -- cgit v1.2.3