summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-26 13:58:20 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-26 13:58:20 +0200
commit4a7eca2e34be18214cfeefa3962487ed521bca20 (patch)
tree2f68ebcfb6a9cdf871a3d89ae2e8ecf857047050
parentd42703ea3bde5fd383c96380918d6b0b0140a60a (diff)
efa-m: implement -V / --track-via option
-rw-r--r--Changelog4
-rwxr-xr-xbin/efa-m17
2 files changed, 18 insertions, 3 deletions
diff --git a/Changelog b/Changelog
index 8d270cd..540df7c 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,7 @@
+git HEAD
+
+ * efa-m: Add -V / --track-via option
+
Travel::Status::DE::VRR 1.10 - Thu Jun 25 2015
* Result->delay: return undef when no data is available. This allows to
diff --git a/bin/efa-m b/bin/efa-m
index 6dcdbdb..54045b6 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -18,7 +18,7 @@ use Travel::Status::DE::EFA;
my $efa_url = 'http://efa.vrr.de/vrr/XSLT_DM_REQUEST';
my ( $date, $time, $input_type, $list_lines, $offset, $relative_times );
my ($full_routes);
-my ($filter_via);
+my ( $filter_via, $track_via );
my ( $timeout, $developer_mode );
my ( @grep_lines, @grep_platforms );
my ( %edata, @edata_pre );
@@ -38,7 +38,8 @@ GetOptions(
'timeout=i' => \$timeout,
'u|efa-url=s' => \$efa_url,
'v|via=s' => \$filter_via,
- 'V|version' => \&show_version,
+ 'V|track-via=s' => sub { $filter_via = $track_via = $_[1] },
+ 'version' => \&show_version,
'devmode' => \$developer_mode,
) or show_help(1);
@@ -219,6 +220,10 @@ sub show_results {
$dtime .= ' CANCELED';
}
}
+ elsif ($track_via) {
+ my $via = first { $_->name =~ m{$filter_via}io } $d->route_post;
+ $dtime .= ' → ' . $via->arr_time;
+ }
if ( $d->delay ) {
$dtime .= ' (+' . $d->delay . ')';
}
@@ -334,7 +339,13 @@ Only show trains serving I<station> after the requseted stop. I<station>
is matched against the "I<city> I<stop>" fields in each line's route.
Regular expressions are also supported.
-=item B<-V>, B<--version>
+=item B<-V>, B<--track-via> I<station>
+
+Lik B<--via>: Only show trains serving I<station> after the requseted stop.
+Also, show the arrival time at I<station> after the departure time at the
+current stop.
+
+=item B<--version>
Show version information.